Sh3ll
OdayForums


Server : LiteSpeed
System : Linux premium84.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User : claqxcrl ( 523)
PHP Version : 8.1.32
Disable Function : NONE
Directory :  /opt/hc_python/lib64/python3.12/site-packages/lxml/html/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/hc_python/lib64/python3.12/site-packages/lxml/html/__pycache__/soupparser.cpython-312.pyc
�

���g�'���dZgd�ZddlZddlmZmZ	ddlmZmZm	Z	m
Z
mZmZm
Z
ee
fZdd�Zdd�Zdd	�Zd
�Zej(dej*�j,ZGd�d
�Zd�Zd�Z	ddlmZej(d�j<Z	e d�Z#y#e$rddlmZmZm	Z	m
Z
mZmZeZY��wxYw#e$r	ddlmZY�MwxYw#e!$re"Z Yd�Z#ywxYw)z5External interface to the BeautifulSoup HTML parser.
)�
fromstring�parse�convert_tree�N)�etree�html)�
BeautifulSoup�Tag�Comment�ProcessingInstruction�NavigableString�Declaration�Doctype)rr	r
rrr
c��t|||fi|��S)a�Parse a string of HTML data into an Element tree using the
    BeautifulSoup parser.

    Returns the root ``<html>`` Element of the tree.

    You can pass a different BeautifulSoup parser through the
    `beautifulsoup` keyword, and a diffent Element factory function
    through the `makeelement` keyword.  By default, the standard
    ``BeautifulSoup`` class and the default factory of `lxml.html` are
    used.
    )�_parse)�data�
beautifulsoup�makeelement�bsargss    �E/opt/hc_python/lib64/python3.12/site-packages/lxml/html/soupparser.pyrrs���$�
�{�=�f�=�=�c�v�t|d�st|�}t|||fi|��}tj|�S)aYParse a file into an ElemenTree using the BeautifulSoup parser.

    You can pass a different BeautifulSoup parser through the
    `beautifulsoup` keyword, and a diffent Element factory function
    through the `makeelement` keyword.  By default, the standard
    ``BeautifulSoup`` class and the default factory of `lxml.html` are
    used.
    �read)�hasattr�openrr�ElementTree)�filerrr�roots     rrr$s;���4�� ��D�z���$�
�{�=�f�=�D����T�"�"rc�n�t||�}|j�}|D]}|j|��|S)aConvert a BeautifulSoup tree to a list of Element trees.

    Returns a list instead of a single root Element to support
    HTML-like soup with more than one root element.

    You can pass a different Element factory through the `makeelement`
    keyword.
    )�
_convert_tree�getchildren�remove)�beautiful_soup_treerr�children�childs     rrr3s:���,�k�:�D����!�H������E����Orc���|�t}t|d�r	d|vrd|d<t|d�r	d|vrd|d<||fi|��}t||�}t|�dk(r|djdk(r|dSd|_|S)	N�
HTML_ENTITIES�convertEntitiesr�DEFAULT_BUILDER_FEATURES�featureszhtml.parser�r)rrr�len�tag)�sourcerrr�treers      rrrEs�����%�
��}�o�.��F�*�(.�F�$�%��}�8�9��V�#�!.�F�:����*�6�*�D���{�+�D�
�4�y�A�~�$�q�'�+�+��/��A�w���D�H��Krz`(?:\s|[<!])*DOCTYPE\s*HTML(?:\s+PUBLIC)?(?:\s+(\'[^\']*\'|"[^"]*"))?(?:\s+(\'[^\']*\'|"[^"]*"))?c��eZdZd�Zd�Zy)�
_PseudoTagc�.�d|_g|_||_y)Nr)�name�attrs�contents)�selfr4s  r�__init__z_PseudoTag.__init__`s����	���
� ��
rc�6�|jj�S�N)r4�__iter__)r5s rr9z_PseudoTag.__iter__es���}�}�%�%�'�'rN)�__name__�
__module__�__qualname__r6r9�rrr0r0^s��!�
(rr0c��|�tjj}dx}}dx}}t|�D]b\}}t	|t
�r7|�|}|}|��|js�,|jj�dk(s�J|}�M|��Pt	|t�s�a|}�d|�gx}}	|j}
n3|jd|}|j||dz}
|j|dzd}	|�2|
j|�}|
d||jz|
|dzdz|_	nt|
�}t|�}||�}|}
t|�D] }||�}|��|
j|�|}
�"|}
|	D] }||�}|��|
j|�|}
�"|�j	|j!�}t'|�}|s	|S|j)�\}}|j+�j,}|xr|dd|_|xr|dd|_|S#t"$r|j$}Y�rwxYw)Nrr*���)r�html_parserr�	enumerate�
isinstancer	r2�lower�_DECLARATION_OR_DOCTYPEr4�indexr0�_init_node_converters�reversed�addprevious�addnext�output_ready�AttributeError�string�_parse_doctype_declaration�groups�getroottree�docinfo�	public_id�
system_url)r"r�first_element_idx�last_element_idx�	html_root�declaration�i�e�pre_root�	post_root�roots�convert_node�res_root�prev�	converted�doctype_string�match�external_id�sys_urirPs                    rrrisg�����&�&�2�2��,0�/��(�"�"�I���-�.���1��a��� �(�$%�!� ��� �Q�V�V�������&�0H��	�
�
 �Z��3J�%K��K�/�� �!�!��9�#�,�,��&�/�/�0B�1B�C��#�,�,�->�?O�PQ�?Q�R��'�0�0�1A�!�1C�1D�E�	����K�K�	�"��"�2�A�Y��);�);�;�e�A�a�C�D�k�I�	���u�%�	�(��5�L��I�&�H��D�
�h�
�� ��O�	�� ����Y�'��D�	 ��D�
�� ��O�	�� ��L�L��#��D�	���	0�(�5�5�7�N�+�>�:���
��O�
$)�<�<�>� �K���*�*�,�4�4�G� +� A��A�b�0A�G��!(�!:�W�Q�r�]�G���O���	0�(�/�/�N�	0�s�G2�2H
�	H
c������	�
��i�g���fd�}��fd��	d
��	fd�	�d��
d��|tt�����
fd��}|t�d��}|t�d��}|t��fd	��}�S)Nc�������fd�}|S)Nc�B���D]}|�|<�j|��|Sr8)�append)�handler�t�
converters�ordered_node_types�typess  ���r�addz5_init_node_converters.<locals>.converter.<locals>.add�s+����� '�
�1�
�"�)�)�!�,���Nrr=)rlrmrjrks` ��r�	converterz(_init_node_converters.<locals>.converter�s���	�
�
rc�:���D]}t||�s��|cSyr8)rB)�noderirjrks  ��r�find_best_converterz2_init_node_converters.<locals>.find_best_converter�s&���#�A��$��"�!�!�}�$�$�rc���	�t|�}|�y|||�S#t$r�|�x}�t|�<Y�-wxYwr8)�type�KeyError)�bs_node�parentrhrjrqs   ��rr\z+_init_node_converters.<locals>.convert_node�sY���	O� ��g��/�G��?���w��'�'��	�	O�2E�g�2N�N�G�j��g��/�	O�s��?�?c��t|t�rKi}|j�D]4\}}t|t�rdj	|�}t|�||<�6|S|D��cic]\}}|t|���}}}|Scc}}w)N� )rB�dict�items�list�join�unescape)�bs_attrs�attribs�k�vs    r�	map_attrsz(_init_node_converters.<locals>.map_attrs�s}���h��%��G� ���(���1��a��&������A�%�a�[���
�)���3;�;�(�$�!�Q�q�(�1�+�~�(�G�;����<s�!A<c��t|�dk(r|jxsd|z|_y|djxsd|z|d_y)Nr�r?)r+�text�tail)rvr�s  r�append_textz*_init_node_converters.<locals>.append_text�s@���v�;�!��!�;�;�,�"��4�F�K�%�b�z���4�"��<�F�2�J�Orc�6��|j}|�/|r�
|�nd}tj||j|��}n |r�
|�ni}�	|j|��}|D]}	�t	|�}|�	|||��|S#t
$rYnwxYw�||��:)N)�attrib)r3r�
SubElementr2rsrt)rurvr3r�resr$rhr\rjrr�s       ����r�convert_tagz*_init_node_converters.<locals>.convert_tag�s�����
�
����*/�i��&�T�G��"�"�6�7�<�<��H�C�*/�i��&�R�G��g�l�l�7�;�C��E�
�$�T�%�[�1���&��E�3�'����
���
��
��
���$s�%B�	B�
Bc�V�tj|�}|�|j|�|Sr8)r�HtmlCommentrg�rurvr�s   r�convert_commentz._init_node_converters.<locals>.convert_comments)�����w�'�����M�M�#���
rc��|jd�r|dd}tj|jdd��}|�|j	|�|S)N�?r?rxr*)�endswithrr�splitrgr�s   r�
convert_piz)_init_node_converters.<locals>.convert_pisO�����C� ��c�r�l�G��)�)�7�=�=��a�+@�A�����M�M�#���
rc�.��|��|t|��yr8)r})rurvr�s  �r�convert_textz+_init_node_converters.<locals>.convert_texts��������� 1�2�rr8)r	r0r
rr)rrnr�r�r�r�r�r\rjrqr�rks`     @@@@@@rrFrF�s�����J�����(�	�=��s�J��� ��,�w������$�%��&������ ��
�r)�name2codepointz&(\w+);c�&�|syd�}t||�S)Nr�c��	tt|jd��S#t$r|jd�cYSwxYw)Nr*r)�unichrr��grouprt)�ms r�unescape_entityz!unescape.<locals>.unescape_entity5s<��	��.������4�5�5���	��7�7�1�:��	�s� #�A�A)�handle_entities)rLr�s  rr}r}1s�����
�?�F�3�3r)NNr8)$�__doc__�__all__�re�lxmlrr�bs4rr	r
rrr
rrD�ImportErrorrrrr�compile�
IGNORECASErarMr0rrF�
html.entitiesr��htmlentitydefs�subr�r��	NameError�chrr}r=rr�<module>r�s
���2��	��	*���� +�G�4��>�#�
�$�$(�R�Z�Z�$��M�M�	��5�	�(�(�R�j^�F.�,�
�"�*�*�Z�(�,�,���
�	4��G	�*���*��	*��j�.�-�.����
�F�	4��s5�B�1B7�C�B4�3B4�7C�C�C�C

ZeroDay Forums Mini