shell bypass 403

Cubjrnet7 Shell


name : soupparser.cpython-39.pyc
a

��a�'�@sLdZgd�ZddlZddlmZmZz0ddlmZmZm	Z	m
Z
mZmZm
Z
ee
fZWn6ey�ddlmZmZm	Z	m
Z
mZmZeZYn0ddd�Zdd	d
�Zddd�Zd
d�Ze�dej�jZGdd�d�Zdd�Zdd�ZzddlmZWn e�yddlmZYn0e�d�jZze Wne!�y>e"Z Yn0dd�Z#dS)z5External interface to the BeautifulSoup HTML parser.
)�
fromstring�parse�convert_tree�N)�etree�html)�
BeautifulSoup�Tag�Comment�ProcessingInstruction�NavigableString�Declaration�Doctype)rrr	r
rrcKst|||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�bsargs�r�:/usr/lib64/python3.9/site-packages/lxml/html/soupparser.pyrsrcKs0t|d�st|�}t|||fi|��}t�|�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�openrrZElementTree)�filerrr�rootrrrr$s	
rcCs*t||�}|��}|D]}|�|�q|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_treeZgetchildren�remove)�beautiful_soup_treerrZchildren�childrrrr3s
	
rcKs�|durt}t|d�r&d|vr&d|d<t|d�r@d|vr@d|d<||fi|��}t||�}t|�dkr||djdkr||dSd|_|S)	NZ
HTML_ENTITIESZconvertEntitiesrZDEFAULT_BUILDER_FEATURESZfeatureszhtml.parser�r)rrr�len�tag)�sourcerrrZtreerrrrrEs


rz`(?:\s|[<!])*DOCTYPE\s*HTML(?:\s+PUBLIC)?(?:\s+(\'[^\']*\'|"[^"]*"))?(?:\s+(\'[^\']*\'|"[^"]*"))?c@seZdZdd�Zdd�ZdS)�
_PseudoTagcCsd|_g|_||_dS)Nr)�name�attrs�contents)�selfr%rrr�__init__`sz_PseudoTag.__init__cCs
|j��S�N)r%�__iter__)r&rrrr)esz_PseudoTag.__iter__N)�__name__�
__module__�__qualname__r'r)rrrrr"^sr"cCs|durtjj}d}}d}}t|�D]Z\}}t|t�rl|durF|}|}|dur�|jr�|j��dkr�|}q(|dur(t|t�r(|}q(|dur�g}}	|j	}
n2|j	d|�}|j	||d�}
|j	|dd�}	|du�r|
�
|�}|
d|�|j	|
|dd�|_	nt|
�}t|�}||�}|}
t
|�D]&}||�}|du�r,|
�|�|}
�q,|}
|	D]&}||�}|du�r\|
�|�|}
�q\|du�rz|��}Wnt�y�|j}Yn0t|�}|�s�n>|��\}}|��j}|�o�|dd�|_|�o|dd�|_|S)Nrr���)rZhtml_parserr�	enumerate�
isinstancerr#�lower�_DECLARATION_OR_DOCTYPEr%�indexr"�_init_node_converters�reversedZaddpreviousZaddnextZoutput_ready�AttributeError�string�_parse_doctype_declaration�groupsZgetroottree�docinfoZ	public_idZ
system_url)rrZfirst_element_idxZlast_element_idxZ	html_rootZdeclaration�i�eZpre_rootZ	post_root�roots�convert_nodeZres_root�prevZ	convertedZdoctype_string�matchZexternal_idZsys_urir9rrrrisd


&





rcs�i�g���fdd�}��fdd��d��fdd�	�dd��d	d
��|tt�����fdd��}|t�d
d��}|t�dd��}|t��fdd��}�S)Ncs���fdd�}|S)Ncs �D]}|�|<��|�q|Sr()�append)�handler�t)�
converters�ordered_node_types�typesrr�add�sz5_init_node_converters.<locals>.converter.<locals>.addr)rErF�rCrD)rEr�	converter�sz(_init_node_converters.<locals>.convertercs$�D]}t||�r�|SqdSr()r/)ZnoderBrGrr�find_best_converter�s
z2_init_node_converters.<locals>.find_best_convertercsNz�t|�}Wn&ty6�|�}�t|�<Yn0|durDdS|||�Sr()�type�KeyError)�bs_node�parentrA)rCrIrrr=�sz+_init_node_converters.<locals>.convert_nodecSsXt|t�rBi}|��D](\}}t|t�r2d�|�}t|�||<qntdd�|D��}|S)N� css|]\}}|t|�fVqdSr(��unescape)�.0�k�vrrr�	<genexpr>��z;_init_node_converters.<locals>.map_attrs.<locals>.<genexpr>)r/�dict�items�list�joinrP)Zbs_attrs�attribsrRrSrrr�	map_attrs�s


z(_init_node_converters.<locals>.map_attrscSs:t|�dkr|jpd||_n|djp*d||d_dS)Nr�r-)r�text�tail)rMr]rrr�append_text�sz*_init_node_converters.<locals>.append_textc	s�|j}|dur2|r�|�nd}tj||j|d�}n|r>�|�ni}�|j|d�}|D]F}z�t|�}WntyzYn0|durT|||�qT�||�qT|S)N)Zattrib)r$rZ
SubElementr#rJrK)rLrMr$rZ�resrrA)r=rCrr[rr�convert_tag�s 
z*_init_node_converters.<locals>.convert_tagcSs t�|�}|dur|�|�|Sr()rZHtmlCommentr@�rLrMr`rrr�convert_comments

z._init_node_converters.<locals>.convert_commentcSs>|�d�r|dd�}tj|�dd��}|dur:|�|�|S)N�?r-rNr)�endswithrr
�splitr@rbrrr�
convert_pis

z)_init_node_converters.<locals>.convert_pics|dur�|t|��dSr(rO)rLrM)r_rr�convert_textsz+_init_node_converters.<locals>.convert_text)N)rr"r	r
r)rrHrarcrgrhr)r_r=rCrIrr[rDrr3�s 



r3)�name2codepointz&(\w+);cCs|sdSdd�}t||�S)Nr\cSs6ztt|�d��WSty0|�d�YS0dS)Nrr)�unichrri�grouprK)�mrrr�unescape_entity5sz!unescape.<locals>.unescape_entity)�handle_entities)r6rmrrrrP1srP)NN)NN)N)$�__doc__�__all__�reZlxmlrrZbs4rrr	r
rrr
r1�ImportErrorrrrr�compile�
IGNORECASEr?r7r"rr3Z
html.entitiesriZhtmlentitydefs�subrnrj�	NameError�chrrPrrrr�<module>s<$ 



�Uc


© 2025 Cubjrnet7