403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/site-packages/bs4/builder/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/bs4/builder/__pycache__/_html5lib.cpython-312.pyc
�

V	�g>Y���dZdgZddlmZmZmZmZmZmZm	Z	m
Z
mZddlm
Z
ddlmZmZmZmZmZmZddlZddlmZmZmZmZmZddlmZmZmZddl Z dd	l!m"Z"dd
lm#Z#m$Z$m%Z%m&Z&e	rddl'm(Z(ddl)m*Z+Gd
�de�Z,Gd�de+jZ�Z.Gd�de/�Z0Gd�de+jb�Z2Gd�de2�Z3Gd�de2�Z4y)�MIT�HTML5TreeBuilder�)	�Any�cast�Dict�Iterable�Optional�Sequence�
TYPE_CHECKING�Tuple�Union)�	TypeAlias)�_AttributeValue�_AttributeValues�	_Encoding�
_Encodings�
_NamespaceURL�
_RawMarkupN)�DetectsXMLParsedAsHTML�
PERMISSIVE�HTML�HTML_5�HTMLTreeBuilder)�NamespacedAttribute�PageElement�nonwhitespace_re)�
namespaces)�Comment�Doctype�NavigableString�Tag��
BeautifulSoup)�basec���eZdZUdZdZeed<eeee	gZ
eeed<dZe
ed<ded<eeed	<			dded	eedeed
eedeeeeeeee
ff
d�Zdedd
fd�Zde
ddfd�Zdedefd�Zy
)rajUse `html5lib <https://github.com/html5lib/html5lib-python>`_ to
    build a tree.

    Note that `HTML5TreeBuilder` does not support some common HTML
    `TreeBuilder` features. Some of these features could theoretically
    be implemented, but at the very least it's quite difficult,
    because html5lib moves the parse tree around as it's being built.

    Specifically:

    * This `TreeBuilder` doesn't use different subclasses of
      `NavigableString` (e.g. `Script`) based on the name of the tag
      in which the string was found.
    * You can't use a `SoupStrainer` to parse only part of a document.
    �html5lib�NAME�featuresT�TRACKS_LINE_NUMBERS�TreeBuilderForHtml5lib�underlying_builder�user_specified_encodingN�markup�document_declared_encoding�exclude_encodings�returnc#�K�||_|df|dffD]&\}}|s�	tjd|�d|�d�d���(tj|d��|dddf��y�w)	Nr.r/zYou provided a value for z0, but the html5lib tree builder doesn't support �.���
stacklevelF)r,�warnings�warnr�warn_if_markup_looks_like_xml)�selfr-r,r.r/�variable�names       �7C:\Python312\Lib\site-packages\bs4/builder/_html5lib.py�prepare_markupzHTML5TreeBuilder.prepare_markupWs�����(?��$�(�)E�F�
� 3�4�
�	�N�H�d���
�
�/��v�5e�fj�ek�kl�m� ��	�	�<�<�V�PQ�R��t�T�5�)�)�s�A�AAc�*�|j�-|jj�tjdd��t	j
|j��}|j�J�||j_t�}t|t�s|j|d<|j|fi|��}t|t�rd|_n6|jj j"d}|j$}||_d|j_y)z�Run some incoming markup through some parsing process,
        populating the `BeautifulSoup` object in `HTML5TreeBuilder.soup`.
        Nz�You provided a value for parse_only, but the html5lib tree builder doesn't support parse_only. The entire document will be parsed.�r4)�tree�override_encodingr)�soup�
parse_onlyr6r7r&�
HTMLParser�create_treebuilderr+�parser�dict�
isinstance�strr,�parse�original_encoding�	tokenizer�stream�charEncodingr;)r9r-rF�extra_kwargs�docrKs      r<�feedzHTML5TreeBuilder.feedus����9�9� �T�Y�Y�%9�%9�%E��M�M�U��
��$�$�$�*A�*A�B���&�&�2�2�2�)/����&��v���&�#�&�15�0L�0L�L�,�-��f�l�l�6�2�\�2���f�c�"�%)�C�!� &� 0� 0� 7� 7� D� D�Q� G��!2� 6� 6��$5�C�!�)-����&��namespaceHTMLElementsc�h�t||j|j��|_|jS)z�Called by html5lib to instantiate the kind of class it
        calls a 'TreeBuilder'.

        :param namespaceHTMLElements: Whether or not to namespace HTML elements.

        :meta private:
        )�store_line_numbers)r*rBrUr+)r9rSs  r<rEz#HTML5TreeBuilder.create_treebuilder�s0��#9�!�4�9�9��AX�AX�#
����&�&�&rR�fragmentc��d|zS)zSee `TreeBuilder`.z)<html><head></head><body>%s</body></html>�)r9rVs  r<�test_fragment_to_documentz*HTML5TreeBuilder.test_fragment_to_document�s
��:�X�E�ErR)NNN)�__name__�
__module__�__qualname__�__doc__r'rI�__annotations__rrrr(r
r)�boolr	rrrrrr=rQrErYrXrRr<rr;s���� �D�#��#�Z���>�H�h�s�m�>�!%���$�0�0�%�i�0�0�
8<�:>�26�*��*�"*�)�!4�*�%-�Y�$7�	*�
$�J�/�*�
�%�
�H�Y�$7��)�9L�d�R�S�	T�
*�<#.�:�#.�$�#.�J
'�%)�
'�	!�
'�F�#�F�#�FrRc	����eZdZUded<eejed<		ddededdedef�fd�
Z	dd�Z
deeefd	dfd
�Z
deded	d
fd�Zded	dfd�Zdd�Zdd�Zdd�Zdd�Zdd
d	efd�Z�xZS)r*r#rBrFNrSrU�kwargsc���|r||_n2tjdtd��ddlm}|	dd|i|��|_tt|�#|�d|_	||_
y)NaKThe optionality of the 'soup' argument to the TreeBuilderForHtml5lib constructor is deprecated as of Beautiful Soup 4.13.0: 'soup' is now required. If you can't pass in a BeautifulSoup object here, or you get this warning and it seems mysterious to you, please contact the Beautiful Soup developer team for possible un-deprecation.�r4rr"rU)�zhtml.parser)rBr6r7�DeprecationWarning�bs4r#�superr*�__init__rFrU)r9rSrBrUrar#�	__class__s      �r<rhzTreeBuilderForHtml5lib.__init__�sq�����D�I��M�M�^�"��
�

*�
&�!��6H��LR��D�I�	�$�d�4�5J�K����"4��rRr0�Elementc�x�|jj�t|j|jd�S�N)rB�resetrj�r9s r<�
documentClassz$TreeBuilderForHtml5lib.documentClass�s'���	�	�����t�y�y�$�)�)�T�2�2rR�tokenc��tt|d�}ttt|d�}ttt|d�}tj|||�}|j
j
|�y)Nr;�publicId�systemId)rrIr	r�for_name_and_idsrB�object_was_parsed)r9rpr;rrrs�doctypes      r<�
insertDoctypez$TreeBuilderForHtml5lib.insertDoctype�sb����e�F�m�,��"&�x��}�e�J�6G�"H��"&�x��}�e�J�6G�"H���*�*�4��8�D���	�	�#�#�G�,rRr;�	namespacec��d}d}|j�F|jr:|jjjj	�\}}|�J�|dz
}|j
j
||||��}t||j
|�S)N�)�
sourceline�	sourcepos)rFrUrLrM�positionrB�new_tagrj)r9r;rxr{r|�tags      r<�elementClassz#TreeBuilderForHtml5lib.elementClass�s���$(�
�#'�	��;�;�"�t�'>�'>�%)�K�K�$9�$9�$@�$@�$I�$I�$K�!�J�	��(�(�(�!�A�
�I��i�i����)�
�i� �
���s�D�I�I�y�1�1rR�data�TextNodec�@�tt|�|j�Srl)r�rrB)r9r�s  r<�commentClassz#TreeBuilderForHtml5lib.commentClass�s�����
�t�y�y�1�1rRc��t��)z�This is only used by html5lib HTMLParser.parseFragment(),
        which is never used by Beautiful Soup, only by the html5lib
        unit tests. Since we don't currently hook into those tests,
        the implementation is left blank.
        ��NotImplementedErrorrns r<�
fragmentClassz$TreeBuilderForHtml5lib.fragmentClass�s
��"�#�#rRc��t���z�This is only used by the html5lib unit tests. Since we
        don't currently hook into those tests, the implementation is
        left blank.
        r�rns r<�getFragmentz"TreeBuilderForHtml5lib.getFragment��
��
"�#�#rRc�N�|jj|j�yrl)rB�append�element�r9�nodes  r<�appendChildz"TreeBuilderForHtml5lib.appendChilds��	
�	�	������&rRc��|jSrl)rBrns r<�getDocumentz"TreeBuilderForHtml5lib.getDocument
s���y�y�rRr�c��t��r�r��r9r�s  r<�testSerializerz%TreeBuilderForHtml5lib.testSerializer
r�rR)NT)r0rj�r�rjr0N)r0r#)rZr[r\r^r	r&rDr_rrhrorrIrwr�r�r�r�r�r�r��
__classcell__)ris@r<r*r*�s����
���X�(�(�)�)�
+/�#'�	5�#�5���'�5�!�	5�
�5�B3�-�4��S��>�-�d�-�2��2��2��2� 2��2��2�$�$�'��$�i�$�C�$rRr*c��eZdZUdZeed<eed<defd�Zdee	e
effd�Zde
dedd	fd
�Z
dee	e
effd�Zdee
fd�Zdefd
�Zde
defd�Zde
defd�Zy	)�AttrListz@Represents a Tag's attributes in a way compatible with html5lib.r��attrsc�Z�||_t|jj�|_yrl)r�rGr�r�s  r<rhzAttrList.__init__s������$�,�,�,�,�-��
rRr0c�d�t|jj��j�Srl)�listr��items�__iter__rns r<r�zAttrList.__iter__s#���D�J�J�$�$�&�'�0�0�2�2rRr;�valueNc��|jjxsi}||jdg�vs@|jj|vrx||j|jjg�vrPt	|t
�s@t	|t�sJ�|jjtj|��}||j|<y)N�*)
r��cdata_list_attributes�getr;rHr�rI�attribute_value_list_classr�findall)r9r;r��	list_attrs    r<�__setitem__zAttrList.__setitem__"s����L�L�6�6�<�"�	��9�=�=��b�)�)��L�L����*��	�
�
�d�l�l�&7�&7��<�<��e�T�*�!�%��-�-�-����?�?�$�,�,�U�3���#����T�rRc�H�t|jj��Srl)r�r�r�rns r<r�zAttrList.items3s���D�J�J�$�$�&�'�'rRc�H�t|jj��Srl�r�r��keysrns r<r�z
AttrList.keys6s���D�J�J�O�O�%�&�&rRc�,�t|j�Srl)�lenr�rns r<�__len__zAttrList.__len__9s���4�:�:��rRc� �|j|Srl)r��r9r;s  r<�__getitem__zAttrList.__getitem__<s���z�z�$��rRc�L�|t|jj��vSrlr�r�s  r<�__contains__zAttrList.__contains__?s���t�D�J�J�O�O�-�.�.�.rR)rZr[r\r]r!r^rrhrrrIrr�r�r�r��intr�r�r_r�rXrRr<r�r�s���J�
�L���.��.�3�(�5��o�)=�#>�?�3�#��#�O�#��#�"(�x��c�?�&:� ;�<�(�'�h�s�m�'���� �� �� �/��/��/rRr�c�h�eZdZUeed<ded<eeed<edefd��Z	de
jfd�Zy)	�BeautifulSoupNoder�r#rBrxr0c��t��)z�Return the html5lib constant corresponding to the type of
        the underlying DOM object.

        NOTE: This property is only accessed by the html5lib test
        suite, not by Beautiful Soup proper.
        r�rns r<�nodeTypezBeautifulSoupNode.nodeTypeHs
��"�#�#rRc��t��rlr�rns r<�	cloneNodezBeautifulSoupNode.cloneNodeTs��!�#�#rRN)
rZr[r\rr^r	r�propertyr�r��treebuilder_base�Noder�rXrRr<r�r�CsE��
��
���
�&�&�
�$�#�$��$�$�+�0�0�$rRr�c�R�eZdZUeed<eeed<dedddeefd�Zdd	�Zde	fd
�Z
eee
eeffZeed<eeefZeed<d
eeddfd�Zee
e�Z	ddededddfd�Z						dd�Zdd�Zdd�Zdefd�Zdej8fd�Zde
eeeffd�Zee�Zy)rjr�rxrBr#c��tjj||j�||_||_||_yrl)r�r�rhr;r�rBrx)r9r�rBrxs    r<rhzElement.__init__\s3��	���&�&�t�W�\�\�:������	�"��rRr�r0Nc��d}t|j�tur|jx}}n|j}||_|�6|j�*t	|t
�s|jj
�|��|jjr�t|jjd�turZ|jjd}|jj||z�}|j|�||j_yt	|t
�r|jj|�}|jjr|jjd�}n=|jj�|jj�}n|j}|jj||j|��y)N���F)�parent�most_recent_element)�typer�r r�rHrI�extract�contentsrB�
new_string�replace_with�_most_recent_element�_last_descendant�next_elementru)r9r��string_child�child�old_element�new_elementr�s       r<r�zElement.appendChilddsp��26��������0�#'�<�<�/�L�5��L�L�E����
�����(��u�c�*��L�L� � �"�
�$����%�%��T�\�\�*�*�2�.�/�?�B�
�,�,�/�/��3�K��)�)�.�.�{�\�/I�J�K��$�$�[�1�-8�D�I�I�*��$��$��	�	�,�,�T�2��
�|�|�$�$�&*�l�l�&C�&C�E�&J�#����*�*�6�
'+�i�i�&@�&@�&B�#�&*�l�l�#��I�I�'�'��d�l�l�@S�
(�
rRc�d�t|jt�riSt|j�Srl)rHr�rr�rns r<�
getAttributeszElement.getAttributes�s$���d�l�l�G�,��I�����%�%rR�_Html5libAttributeName�_Html5libAttributes�
attributesc���|��t|�dkDr�t|j��D]&\}}t|t�s�t|�}||=|||<�(t
t|�}|jjj|j|�t|j��D]\}}||j|<�|jjj|j�yyy�Nr)r�r�r�rH�tuplerrrrB�builder�$_replace_cdata_list_attribute_valuesr;r��set_up_substitutions)r9r�r;r��new_name�normalized_attributes�value_or_valuess       r<�
setAttributeszElement.setAttributes�s����!�c�*�o��&9� $�J�$4�$4�$6�7�
1���e��d�E�*�2�D�9�H�"�4�(�+0�J�x�(�	
1�%)�)9�:�$F�!�
�I�I���B�B��	�	�0�
�*.�.C�.I�.I�.K�)L�
5�%��o�%4����T�"�
5�
�I�I���2�2�4�<�<�@�;':�!rRr��insertBeforec��t|jj|�|j�}|r|j||�y|j	|�yrl)r�rBr�r�r�)r9r�r��texts    r<�
insertTextzElement.insertText�sD����	�	�,�,�T�2�D�I�I�>������d�L�1����T�"rRc�2�|jj|j�}t|j�tur�|jjr�t|jj|dz
�turi|jj|dz
}t|�tusJ�|j
j
||jz�}|j|�y|jj||j�||_	y)Nrz)
r��indexr�r r�rBr�r��insertr�)r9r��refNoder��old_node�new_strs      r<r�zElement.insertBefore�s������"�"�7�?�?�3�������/�1����%�%��T�\�\�*�*�5�1�9�5�6�/�I��|�|�,�,�U�Q�Y�7�H���>�_�4�4�4��i�i�*�*�8�d�l�l�+B�C�G��!�!�'�*��L�L����t�|�|�4��D�KrRc�8�|jj�yrl)r�r�r�s  r<�removeChildzElement.removeChild�s�������rRc�n�|j}|j}|j}|jdd�}t|j�dkDr |�J�|jd}|j
}nd}|j
}|j}t|�dkDrh|d}	|�||	_n||	_||	_|�|	|_n|	|_|�|	|_|djdd��}
|
�J�||
_|�|
|_d|
_|D]$}||_|jj|��&g|_||_y)z1Move all of this tag's children into another tag.FrNr�T)�is_initialized�accept_self)
r��next_siblingr�r�r�r��previous_element�previous_siblingr�r�)r9�
new_parentr��new_parent_element�final_next_element�new_parents_last_descendant�new_parents_last_child�(new_parents_last_descendant_next_element�	to_append�first_child�last_childs_last_descendantr�s            r<�reparentChildrenzElement.reparentChildren�s����,�,��'�/�/��%�1�1��&8�&I�&I�%�QV�&W�#��!�*�*�+�a�/�/�:�:�:�%7�%@�%@��%D�"�+�8�8�
5�
&*�"�7I�7V�7V�4��$�$�	��y�>�A��$�A�,�K�*�6�/J��,�/A��,�+A�K�(�*�6�;F�+�8�2=�"�/�%�1�6A�&�3�+4�B�-�*H�*H�$�$�+I�+�'�/�:�:�:�8�
(�4�8�C�0�9�I�8<�'�4��	6�E�-�E�L��'�'�.�.�u�5�	6�
���1��rRc�F�t|jj�dkDSr�)r�r�r�rns r<�
hasContentzElement.hasContent7s���4�<�<�(�(�)�A�-�-rRc��|jj|jj|j�}t||j|j�}|jD]\}}||j|<�|Srl)rBr~r�r;rxrjr�)r9rr��keyr�s     r<r�zElement.cloneNode<sf���i�i������ 1� 1�4�>�>�B���s�D�I�I�t�~�~�6���/�/�	)�J�C��#(�D�O�O�C� �	)��rRc�t�|j�td|jfS|j|jfS)N�html)rxrr;rns r<�getNameTuplezElement.getNameTupleCs3���>�>�!��f�%�t�y�y�0�0��>�>�4�9�9�,�,rR)r�r�r0Nrl)r�r�r�r�r0Nr�)r�rjr0N) rZr[r\r!r^r	rrhr�r�r�r
rIrr�rrr�r�r�r�r�r�r�r�r_r�r�r�r�r�	nameTuplerXrRr<rjrjXsA��
�L��
�&�&�#��#�"1�#�>F�}�>U�#�1�f&�x�&�).�c�5��c��?�.B�(C��I�C�&*�*@�#�*E�%F���F�A��1D�(E�A�$�A�@�-��7�J�HL�#��#�'/�0C�'D�#�	
�#��'��2E��	
��$�L2�h.�D�.�
�+�0�0��-�e�H�]�$;�S�$@�A�-���&�IrRrjc�(�eZdZUeed<deddfd�Zy)r�r�rBr#c�`�tjj|d�||_||_yrl)r�r�rhr�rB)r9r�rBs   r<rhzTextNode.__init__Os&�����&�&�t�T�2������	rRN)rZr[r\r r^rhrXrRr<r�r�Ls��
������rRr�)5�__license__�__all__�typingrrrrr	r
rrr
�typing_extensionsr�bs4._typingrrrrrrr6�bs4.builderrrrrr�bs4.elementrrrr&�html5lib.constantsrrrr r!rfr#�html5lib.treebuildersr$r�r�TreeBuilderr*�objectr�r�r�rjr�rXrRr<�<module>rs��������
�
�
�(��������
�����!�:�pF��pF�fd$�-�9�9�d$�N+/�v�+/�\$�(�-�-�$�*q'��q'�h� �rR

Youez - 2016 - github.com/yon3zu
LinuXploit