Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/lxml/html/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/lxml/html/__pycache__/soupparser.cpython-311.pyc

�

�܋f�'���dZgd�ZddlZddlmZmZ	ddlmZmZm	Z	m
Z
mZmZm
Z
ee
fZn#e$rddlmZmZm	Z	m
Z
mZmZeZYnwxYwdd�Zdd�Zdd	�Zd
�Zejdej��jZGd�d
��Zd�Zd�Z	ddlmZn#e$r	ddlmZYnwxYwejd��jZ	e n
#e!$re"Z YnwxYwd�Z#dS)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    �g/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/lxml/html/soupparser.pyrrs���$�
�{�=�=�f�=�=�=�c��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$sK���4�� � ���D�z�z���$�
�{�=�=�f�=�=�D���T�"�"�"rc��t||��}|���}|D]}|�|���|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     rrr3sN���,�k�:�:�D����!�!�H��������E������Orc��|�t}t|d��r	d|vrd|d<t|d��r	d|vrd|d<||fi|��}t||��}t|��dkr|djdkr|dSd|_|S)	N�
HTML_ENTITIES�convertEntitiesr�DEFAULT_BUILDER_FEATURES�featureszhtml.parser�r)rrr�len�tag)�sourcerrr�treers      rrrEs�����%�
��}�o�.�.�/��F�*�*�(.�F�$�%��}�8�9�9�/��V�#�#�!.�F�:���=��*�*�6�*�*�D���{�+�+�D�
�4�y�y�A�~�~�$�q�'�+��/�/��A�w���D�H��Krz`(?:\s|[<!])*DOCTYPE\s*HTML(?:\s+PUBLIC)?(?:\s+(\'[^\']*\'|"[^"]*"))?(?:\s+(\'[^\']*\'|"[^"]*"))?c��eZdZd�Zd�ZdS)�
_PseudoTagc�0�d|_g|_||_dS)Nr)�name�attrs�contents)�selfr4s  r�__init__z_PseudoTag.__init__`s����	���
� ��
�
�
rc�4�|j���S�N)r4�__iter__)r5s rr9z_PseudoTag.__iter__es���}�%�%�'�'�'rN)�__name__�
__module__�__qualname__r6r9�rrr0r0^s2������!�!�!�
(�(�(�(�(rr0c�Z�|�tjj}dx}}dx}}t|��D]b\}}t	|t
��r/|�|}|}|�&|jr|j���dkr|}�I|�t	|t��r|}�c|�gx}}	|j	}
n3|j	d|�}|j	||dz�}
|j	|dzd�}	|�;|
�
|��}|
d|�|j	z|
|dzd�z|_	nt|
��}t|��}||��}|}
t|��D]&}||��}|�|
�|��|}
�'|}
|	D]&}||��}|�|
�|��|}
�'|��	|���}n#t"$r
|j}YnwxYwt'|��}|snR|���\}}|���j}|o	|dd�|_|o	|dd�|_|S)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                    rrris������&�2��,0�/��(�"�"�I���-�.�.�����1��a����	� �(�$%�!� ��� �Q�V� �������&�0H�0H��	��
�
 �Z��3J�%K�%K�
 ��K��� �!�!��9�#�,���&�/�0B�1B�0B�C��#�,�->�?O�PQ�?Q�-Q�R��'�0�1A�!�1C�1D�1D�E�	����K�K�	�"�"��"�2�A�2�Y��);�;�e�A�a�C�D�D�k�I�	����u�%�%�	�(��5�5�L��|�I�&�&�H��D�
�h�
�
���� �L��O�O�	�� ����Y�'�'�'��D���D�
���� �L��O�O�	�� ��L�L��#�#�#��D����	0�(�5�5�7�7�N�N���	0�	0�	0�(�/�N�N�N�	0����+�>�:�:���		;�
�#(�<�<�>�>� �K���*�*�,�,�4�G� +� A��A�b�D�0A�G��!(�!:�W�Q�r�T�]�G���Os�F0�0G�Gc�0�����	�
��i�g���fd�}��fd��	d
��	fd�	�d��
d��|tt������
fd���}|t��d���}|t��d���}|t���fd	���}�S)Nc�������fd�}|S)Nc�F���D]}|�|<��|���|Sr8)�append)�handler�t�
converters�ordered_node_types�typess  ���r�addz5_init_node_converters.<locals>.converter.<locals>.add�s7����
-�
-�� '�
�1�
�"�)�)�!�,�,�,�,��Nrr=)rlrmrjrks` ��r�	converterz(_init_node_converters.<locals>.converter�s.����	�	�	�	�	�	�	�
�
rc�F���D]}t||��r
�|cS�dSr8)rB)�noderirjrks  ��r�find_best_converterz2_init_node_converters.<locals>.find_best_converter�s>���#�	%�	%�A��$��"�"�
%�!�!�}�$�$�$�
%��trc���	�t|��}n-#t$r �|��x}�t|��<YnwxYw|�dS|||��Sr8)�type�KeyError)�bs_node�parentrhrjrqs   ��rr\z+_init_node_converters.<locals>.convert_node�s|���	O� ��g���/�G�G���	O�	O�	O�2E�2E�g�2N�2N�N�G�j��g���/�/�/�	O�����?��4��w�w��'�'�'s��'A�Ac��t|t��rYi}|���D]A\}}t|t��rd�|��}t|��||<�Bntd�|D����}|S)N� c3�>K�|]\}}|t|��fV��dSr8��unescape)�.0�k�vs   r�	<genexpr>z;_init_node_converters.<locals>.map_attrs.<locals>.<genexpr>�s1����A�A���1�A�x��{�{�+�A�A�A�A�A�Ar)rB�dict�items�list�joinr{)�bs_attrs�attribsr}r~s    r�	map_attrsz(_init_node_converters.<locals>.map_attrs�s����h��%�%�	B��G� ���(�(�
)�
)���1��a��&�&�$�������A�%�a�[�[���
�
�
)�
�A�A��A�A�A�A�A�G��rc��t|��dkr|jpd|z|_dS|djpd|z|d_dS)Nr�r?)r+�text�tail)rvr�s  r�append_textz*_init_node_converters.<locals>.append_text�sI���v�;�;�!���!�;�,�"��4�F�K�K�K�%�b�z��4�"��<�F�2�J�O�O�Orc�@��|j}|�,|r�
|��nd}tj||j|���}n!|r�
|��ni}�	|j|���}|D]C}	�t	|��}|�|||���'#t
$rYnwxYw�||���D|S)N)�attrib)r3r�
SubElementr2rsrt)rurvr3r��resr$rhr\rjrr�s       ����r�convert_tagz*_init_node_converters.<locals>.convert_tag�s�����
����*/�9�i�i��&�&�&�T�G��"�6�7�<��H�H�H�C�C�*/�7�i�i��&�&�&�R�G��+�g�l�7�;�;�;�C��
	%�
	%�E�
�$�T�%�[�[�1���&��G�E�3�'�'�'����
�
�
���
����
�L���$�$�$�$��
s�B�
B�
Bc�\�tj|��}|�|�|��|Sr8)r�HtmlCommentrg�rurvr�s   r�convert_commentz._init_node_converters.<locals>.convert_comments/����w�'�'�����M�M�#�����
rc��|�d��r
|dd�}tj|�dd���}|�|�|��|S)N�?r?rxr*)�endswithrr�splitrgr�s   r�
convert_piz)_init_node_converters.<locals>.convert_pis_�����C� � �	#��c�r�c�l�G��)�7�=�=��a�+@�+@�A�����M�M�#�����
rc�>��|��|t|����dSr8rz)rurvr�s  �r�convert_textz+_init_node_converters.<locals>.convert_texts(������K���� 1� 1�2�2�2��trr8)r	r0r
rr)rrnr�r�r�r�r�r\rjrqr�rks`     @@@@@@rrFrF�sW����������J���������������(�(�(�(�(�(�(�	�	�	�=�=�=��Y�s�J���������� ���,�Y�w���������Y�$�%�%���&�%���Y�������� ���
�r)�name2codepointz&(\w+);c�0�|sdSd�}t||��S)Nr�c��	tt|�d����S#t$r|�d��cYSwxYw)Nr*r)�unichrr��grouprt)�ms r�unescape_entityz!unescape.<locals>.unescape_entity5sU��	��.�������4�5�5�5���	�	�	��7�7�1�:�:����	���s�,/�A�A)�handle_entities)rLr�s  rr{r{1s0�����r����
�?�F�3�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�
1�
1��	�	�	�	���������	*������������������� +�G�4�����*�*�*�����������������*����	*����>�>�>�>�#�#�#�#�
�
�
�
�$���$(�R�Z�$��M�	���	�(�(�(�(�(�(�(�(�R�R�R�j^�^�^�F.�,�,�,�,�,�,�,���.�.�.�-�-�-�-�-�-�-�-�.�����"�*�Z�(�(�,���
�F�F������
�F�F�F�����
	4�	4�	4�	4�	4s3�+�A�A�B
�
B�B�4B7�7C�C

Hacked By AnonymousFox1.0, Coded By AnonymousFox