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__/_htmlparser.cpython-312.pyc
�

V	�g�E��2�dZddlmZdZdgZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZddlmZmZmZmZmZmZddlmZmZdd	lmZmZm Z m!Z!dd
l"m#Z#erddl$m%Z%ddlm&Z&dd
l'm(Z(m)Z)m*Z*dZ+e	ee,e,fe,e,gdfZ-Gd�dee�Z.Gd�de �Z/y)zCUse the HTMLParser library to parse HTML files that aren't too bad.�)�annotations�MIT�HTMLParserTreeBuilder)�
HTMLParser)�Any�Callable�cast�Dict�Iterable�List�Optional�
TYPE_CHECKING�Tuple�Type�Union)�
AttributeDict�CData�Comment�Declaration�Doctype�ProcessingInstruction)�EntitySubstitution�
UnicodeDammit)�DetectsXMLParsedAsHTML�HTML�HTMLTreeBuilder�STRICT��ParserRejectedMarkup)�
BeautifulSoup)�NavigableString)�	_Encoding�
_Encodings�
_RawMarkupzhtml.parserNc���eZdZUdZded<dZded<	ed�							dd�Zd
ed	<ded
<ded<dd�Z						dd�Z	d							dd�Z	ddd�Z
d d�Zd!d�Zd!d�Z
d d�Zd d�Zd d�Zd d�Zy)"�BeautifulSoupHTMLParser�replace�str�REPLACE�ignore�IGNORE��on_duplicate_attribute�soupr r-�&Union[str, _DuplicateAttributeHandler]c��||_||_|jj|_t	j
|g|��i|��g|_|j�y�N)r.r-�builder�attribute_dict_classr�__init__�already_closed_empty_element�_initialize_xml_detector)�selfr.r-�args�kwargss     �9C:\Python312\Lib\site-packages\bs4/builder/_htmlparser.pyr4z BeautifulSoupHTMLParser.__init__TsS����	�&<��#�$(�L�L�$E�$E��!����D�2�4�2�6�2�-/��)��%�%�'�z	List[str]r5c��t|��r1r)r7�messages  r:�errorzBeautifulSoupHTMLParser.erroros��#�7�+�+r;c�N�|j||d��|j|�y)z�Handle an incoming empty-element tag.

        html.parser only calls this method when the markup looks like
        <tag/>.
        F)�handle_empty_elementN)�handle_starttag�
handle_endtag)r7�name�attrss   r:�handle_startendtagz*BeautifulSoupHTMLParser.handle_startendtags'��	
���T�5�u��E����4� r;c�V�|j�}|D]_\}}|�d}||vrM|j}||jk(r�*|d|jfvr|||<�@t	t
|�}||||��[|||<�a|jjjr|j�\}}	ndx}}	|jj|dd|||	��}
|
r<|
jr0|r.|j|d��|jj|�|j�|j!|�yy)z�Handle an opening tag, e.g. '<tag>'

        :param handle_empty_element: True if this tag is known to be
            an empty-element tag (i.e. there is not expected to be any
            closing tag).
        N�)�
sourceline�	sourceposF)�check_already_closed)r3r-r+r)r	�_DuplicateAttributeHandlerr.r2�store_line_numbers�getposrA�is_empty_elementrBr5�append�_root_tag_name�_root_tag_encountered)r7rCrDr@�	attr_dict�key�value�on_duperHrI�tags           r:rAz'BeautifulSoupHTMLParser.handle_starttag�s@��$(�#<�#<�#>�	��	'�J�C���}����i���5�5���d�k�k�)����t�|�|� 4�4�%*�I�c�N�"�#=�w�G�G��I�s�E�2�!&�	�#��%	'�,�9�9���/�/�$(�K�K�M�!�J�	�%)�)�J���i�i�'�'��$��i�J�)�(�
���3�'�'�,@�
���t�%��@�
�-�-�4�4�T�:����&��&�&�t�,�'r;c��|r*||jvr|jj|�y|jj|�y)z�Handle a closing tag, e.g. '</tag>'

        :param name: A tag name.
        :param check_already_closed: True if this tag is expected to
           be the closing portion of an empty-element tag,
           e.g. '<tag></tag>'.
        N)r5�remover.rB)r7rCrJs   r:rBz%BeautifulSoupHTMLParser.handle_endtag�s<�� �D�D�,M�,M�$M�

�-�-�4�4�T�:��I�I�#�#�D�)r;c�:�|jj|�y)z4Handle some textual data that shows up between tags.N)r.�handle_data�r7�datas  r:rZz#BeautifulSoupHTMLParser.handle_data�s���	�	���d�#r;c���|jd�rt|jd�d�}n8|jd�rt|jd�d�}nt|�}d}|dkr<|jjdfD]!}|s�	t|g�j
|�}�#|s	t|�}|xsd}|j|�y#t$rY�UwxYw#ttf$rY�8wxYw)z�Handle a numeric character reference by converting it to the
        corresponding Unicode character and treating it as textual
        data.

        :param name: Character number, possibly in hexadecimal.
        �x��XN�zwindows-1252u�)�
startswith�int�lstripr.�original_encoding�	bytearray�decode�UnicodeDecodeError�chr�
ValueError�
OverflowErrorrZ)r7rC�	real_namer\�encodings     r:�handle_charrefz&BeautifulSoupHTMLParser.handle_charref�s����?�?�3���D�K�K��,�b�1�I�
�_�_�S�
!��D�K�K��,�b�1�I��D�	�I����s�?�"�Y�Y�8�8�.�I�
�����$�i�[�1�8�8��B�D�	
��
��9�~���2�2��������*�����
�
�.�
��
�s$�C�,C�	C�C�C0�/C0c�x�tjj|�}|�|}nd|z}|j|�y)z�Handle a named entity reference by converting it to the
        corresponding Unicode character(s) and treating it as textual
        data.

        :param name: Name of the entity reference.
        Nz&%s)r�HTML_ENTITY_TO_CHARACTER�getrZ)r7rC�	characterr\s    r:�handle_entityrefz(BeautifulSoupHTMLParser.handle_entityref
s>��'�?�?�C�C�D�I�	�� ��D��4�<�D�����r;c��|jj�|jj|�|jjt�y)zOHandle an HTML comment.

        :param data: The text of the comment.
        N)r.�endDatarZrr[s  r:�handle_commentz&BeautifulSoupHTMLParser.handle_comments8��
	
�	�	�����	�	���d�#��	�	���'�"r;c���|jj�|td�d}|jj|�|jjt�y)zYHandle a DOCTYPE declaration.

        :param data: The text of the declaration.
        zDOCTYPE N)r.ru�lenrZrr[s  r:�handle_declz#BeautifulSoupHTMLParser.handle_decl&sI��
	
�	�	�����C�
�O�%�&���	�	���d�#��	�	���'�"r;c��|j�jd�rt}|td�d}nt}|j
j
�|j
j|�|j
j
|�y)z{Handle a declaration of unknown type -- probably a CDATA block.

        :param data: The text of the declaration.
        zCDATA[N)�upperrbrrxrr.rurZ)r7r\�clss   r:�unknown_declz$BeautifulSoupHTMLParser.unknown_decl0sf���:�:�<�"�"�8�,��C���H�
��(�D��C��	�	�����	�	���d�#��	�	���#�r;c���|jj�|jj|�|j|�|jjt�y)z\Handle a processing instruction.

        :param data: The text of the instruction.
        N)r.rurZ�_document_might_be_xmlrr[s  r:�	handle_piz!BeautifulSoupHTMLParser.handle_pi?sG��
	
�	�	�����	�	���d�#��#�#�D�)��	�	���/�0r;N)r.r r8rr-r/r9r)r=r(�return�None)rCr(rD�List[Tuple[str, Optional[str]]]r�r�)T)rCr(rDr�r@�boolr�r�)rCr(rJr�r�r�)r\r(r�r�)rCr(r�r�)�__name__�
__module__�__qualname__r)�__annotations__r+r4r>rErArBrZrnrsrvryr}r��r;r:r&r&=s����G�S���F�C���$JQ�	(��(��(�!G�	(�
�(�.C�B�"+�+�
��,� 
!��
!� ?�
!�	
�
!�&&*�	<-��<-�/�<-�#�	<-�

�<-�|*�$$�&�P�&#�#�
�1r;r&c���eZdZUdZdZded<dZded<eZded<ee	e
gZd	ed
<ded<dZded
<		d					d�fd�
Z
			d									dd�Zdd�Z�xZS)rz�A Beautiful soup `bs4.builder.TreeBuilder` that uses the
    :py:class:`html.parser.HTMLParser` parser, found in the Python
    standard library.

    Fr��is_xmlT�	picklabler(�NAMEz
Iterable[str]�featuresz$Tuple[Iterable[Any], Dict[str, Any]]�parser_args�TRACKS_LINE_NUMBERSc����t�}dD]}||vs�|j|�}|||<�tt|�di|��|xsg}|xsi}|j|�d|d<||f|_y)a�Constructor.

        :param parser_args: Positional arguments to pass into
            the BeautifulSoupHTMLParser constructor, once it's
            invoked.
        :param parser_kwargs: Keyword arguments to pass into
            the BeautifulSoupHTMLParser constructor, once it's
            invoked.
        :param kwargs: Keyword arguments for the superclass constructor.
        r,F�convert_charrefsNr�)�dict�pop�superrr4�updater�)r7r��
parser_kwargsr9�extra_parser_kwargs�argrT�	__class__s       �r:r4zHTMLParserTreeBuilder.__init__[s����$#�f��.�	1�C��f�}��
�
�3���+0�#�C�(�	1�	�#�T�3�=�f�=�!�'�R��%�+��
����0�1�,1�
�(�)�'��7��r;c#�@K�t|t�r	|dddf��yg}|r|j|�g}|r|j|�t|||d|��}|j�td��|j|j|j|jf��y�w)a2Run any preliminary steps necessary to make incoming markup
        acceptable to the parser.

        :param markup: Some markup -- probably a bytestring.
        :param user_specified_encoding: The user asked to try this encoding.
        :param document_declared_encoding: The markup itself claims to be
            in this encoding.
        :param exclude_encodings: The user asked _not_ to try any of
            these encodings.

        :yield: A series of 4-tuples: (markup, encoding, declared encoding,
             has undergone character replacement)

            Each 4-tuple represents a strategy for parsing the document.
            This TreeBuilder uses Unicode, Dammit to convert the markup
            into Unicode, so the ``markup`` element of the tuple will
            always be a string.
        NFT)�known_definite_encodings�user_encodings�is_html�exclude_encodingszPCould not convert input to Unicode, and html.parser will not accept bytestrings.)	�
isinstancer(rOr�unicode_markuprre�declared_html_encoding�contains_replacement_characters)r7�markup�user_specified_encoding�document_declared_encodingr�r�r��dammits        r:�prepare_markupz$HTMLParserTreeBuilder.prepare_markupys�����2�f�c�"��4��u�-�-��57� �"�

%�+�+�,C�D�*,��%�
�!�!�"<�=���%=�)��/�
��� � �(�'�b��
�
�%�%��(�(��-�-��6�6�	�
�s�BBc��|j\}}t|t�sJ�|j�J�t	|jg|��i|��}	|j|�|j
�g|_	y#t$r}t|��d}~wwxYwr1)
r�r�r(r.r&�feed�close�AssertionErrorrr5)r7r�r8r9�parser�es      r:r�zHTMLParserTreeBuilder.feed�s����'�'���f��&�#�&�&�&�
�y�y�$�$�$�(����D�T�D�V�D��	*��K�K����L�L�N�/1��+���	*�'�q�)�)��		*�s�
!A3�3	B�<B�B)NN)r�zOptional[Iterable[Any]]r�zOptional[Dict[str, Any]]r9r)NNN)
r�r$r��Optional[_Encoding]r�r�r�zOptional[_Encodings]r�zDIterable[Tuple[str, Optional[_Encoding], Optional[_Encoding], bool]])r�r$r�r�)r�r�r��__doc__r�r�r��
HTMLPARSERr�rrr�r�r4r�r��
__classcell__)r�s@r:rrJs������F�D���I�t���D�#��#�T�6�2�H�m�2�5�5�!%���$�04�26�8�,�8�0�8��	8�B8<�:>�26�F��F�"5�F�%8�	F�
0�F�
N�
F�P1r;)0r��
__future__r�__license__�__all__�html.parserr�typingrrr	r
rrr
rrrr�bs4.elementrrrrrr�
bs4.dammitrr�bs4.builderrrrr�bs4.exceptionsr�bs4r r!�bs4._typingr"r#r$r�r(rKr&rr�r;r:�<module>r�s���I�"������#�������9���0��!�+����
�%�t�C��H�~�s�C�&@�$�&F�G��J1�j�*@�J1�ZP1�O�P1r;

Youez - 2016 - github.com/yon3zu
LinuXploit