shell bypass 403

Cubjrnet7 Shell


name : html5parser.cpython-39.pyc
a

��a�!�@shdZddlZddlZddlmZddlmZddlm	Z	ddl
mZmZm
Z
zeZWneyneefZYn0zddlmZWney�ddlmZYn0zddlmZWney�ddlmZYn0Gd	d
�d
e�ZzddlmZWne�yYn0Gdd
�d
e�Ze�Zdd�Zddd�Zddd�Zddd�Zd dd�Z d!dd�Z!dd�Z"e�Z#dS)"z?
An interface to html5lib that mimics the lxml.html interface.
�N)�
HTMLParser)�TreeBuilder)�etree)�Element�XHTML_NAMESPACE�_contains_block_level_tag)�urlopen)�urlparsec@seZdZdZddd�ZdS)rz*An html5lib HTML parser with lxml as tree.FcKstj|f|td�|��dS�N)�strict�tree)�_HTMLParser�__init__r��selfr�kwargs�r�;/usr/lib64/python3.9/site-packages/lxml/html/html5parser.pyrszHTMLParser.__init__N)F��__name__�
__module__�__qualname__�__doc__rrrrrrsr)�XHTMLParserc@seZdZdZddd�ZdS)rz+An html5lib XHTML Parser with lxml as tree.FcKstj|f|td�|��dSr
)�_XHTMLParserrrrrrrr*szXHTMLParser.__init__N)Frrrrrr'srcCs(|�|�}|dur|S|�dt|f�S)Nz{%s}%s)�findr)r�tag�elemrrr�	_find_tag0s
rcCs^t|t�std��|durt}i}|dur8t|t�r8d}|durH||d<|j|fi|����S)z�
    Parse a whole document into a string.

    If `guess_charset` is true, or if the input is not Unicode but a
    byte string, the `chardet` library will perform charset guessing
    on the string.
    �string requiredNT�
useChardet)�
isinstance�_strings�	TypeError�html_parser�bytes�parseZgetroot)�html�
guess_charset�parser�optionsrrr�document_fromstring7s
r+FcCs�t|t�std��|durt}i}|dur8t|t�r8d}|durH||d<|j|dfi|��}|r�t|dt�r�|r�|d��r�t�d|d��|d=|S)a`Parses several HTML elements, returning a list of elements.

    The first item in the list may be a string.  If no_leading_text is true,
    then it will be an error if there is leading text, and it will always be
    a list of only elements.

    If `guess_charset` is true, the `chardet` library will perform charset
    guessing on the string.
    rNFr �divrzThere is leading text: %r)	r!r"r#r$r%Z
parseFragment�stripr�ParserError)r'�no_leading_textr(r)r*Zchildrenrrr�fragments_fromstringOs$
�r0cCs�t|t�std��t|�}t||||d�}|rvt|t�s>d}t|�}|rrt|dt�rh|d|_|d=|�|�|S|s�t�	d��t
|�dkr�t�	d��|d}|jr�|j��r�t�	d|j��d	|_|S)
a�Parses a single HTML element; it is an error if there is more than
    one element, or if anything but whitespace precedes or follows the
    element.

    If 'create_parent' is true (or is a tag name) then a parent node
    will be created to encapsulate the HTML in a single element.  In
    this case, leading or trailing text is allowed.

    If `guess_charset` is true, the `chardet` library will perform charset
    guessing on the string.
    r)r(r)r/r,rzNo elements found�zMultiple elements foundzElement followed by text: %rN)
r!r"r#�boolr0r�text�extendrr.�len�tailr-)r'Z
create_parentr(r)Zaccept_leading_text�elementsZnew_root�resultrrr�fragment_fromstringqs4
�




r9cCs�t|t�std��t|||d�}|dd�}t|t�rB|�dd�}|����}|�d�sb|�d�rf|St	|d	�}t
|�r||St	|d
�}t
|�dkr�|jr�|j��s�|dj
r�|dj
��s�|d
St|�r�d|_nd|_|S)a�Parse the html, returning a single element/document.

    This tries to minimally parse the chunk of text, without knowing if it
    is a fragment or a document.

    'base_url' will set the document's base_url attribute (and the tree's
    docinfo.URL)

    If `guess_charset` is true, or if the input is not Unicode but a
    byte string, the `chardet` library will perform charset guessing
    on the string.
    r)r)r(N�2�ascii�replacez<htmlz	<!doctype�head�bodyr1���rr,�span)r!r"r#r+r%�decode�lstrip�lower�
startswithrr5r3r-r6rr)r'r(r)�doc�startr=r>rrr�
fromstring�s2
�


��rGcCs~|durt}t|t�s(|}|dur\d}n4t|�rFt|�}|dur\d}nt|d�}|dur\d}i}|rl||d<|j|fi|��S)a*Parse a filename, URL, or file-like object into an HTML document
    tree.  Note: this returns a tree, not an element.  Use
    ``parse(...).getroot()`` to get the document root.

    If ``guess_charset`` is true, the ``useChardet`` option is passed into
    html5lib to enable character detection.  This option is on by default
    when parsing from URLs, off by default when parsing from file(-like)
    objects (which tend to return Unicode more often than not), and on by
    default when parsing from a file path (which is read in binary mode).
    NFT�rbr )r$r!r"�_looks_like_urlr�openr&)Zfilename_url_or_filer(r)�fpr*rrrr&�s"

r&cCs@t|�d}|sdStjdkr8|tjvr8t|�dkr8dSdSdS)NrF�win32r1T)r	�sys�platform�string�
ascii_lettersr5)�str�schemerrrrI�s
�
�rI)NN)FNN)FNN)NN)NN)$rrMrOZhtml5librr
Z html5lib.treebuilders.etree_lxmlrZlxmlrZ	lxml.htmlrrrZ
basestringr"�	NameErrorr%rQZurllib2r�ImportErrorZurllib.requestr	�urllib.parserrZxhtml_parserrr+r0r9rGr&rIr$rrrr�<module>sJ
�
"�
,
6
$

© 2025 Cubjrnet7