/usr/lib/python3/dist-packages/lxml/html/__pycache__
Edit: /usr/lib/python3/dist-packages/lxml/html/__pycache__/soupparser.cpython-310.pyc (7993B)
o
;/b' @ sH d Z g dZddlZddlmZmZ zddlmZmZm Z m
Z
mZmZm
Z
ee
fZW n eyE ddlmZmZm Z m
Z
mZmZ eZY nw dddZdd d
ZdddZd
d ZedejjZG dd dZdd Zdd ZzddlmZ W n ey ddlmZ Y nw edjZze W n e!y e"Z Y nw dd Z#dS )z5External interface to the BeautifulSoup HTML parser.
)
fromstringparseconvert_tree N)etreehtml)
BeautifulSoupTagCommentProcessingInstructionNavigableStringDeclarationDoctype)r r r r
r r c K s t | ||fi |S )a Parse a string of HTML data into an Element tree using the
BeautifulSoup parser.
Returns the root ```` 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
beautifulsoupmakeelementbsargs r 6/usr/lib/python3/dist-packages/lxml/html/soupparser.pyr s r c K s0 t | ds t| } t| ||fi |}t|S )aY Parse 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)hasattropenr r ElementTree)filer r r rootr r r r $ s
r c C s* t | |}| }|D ]}|| q|S )a Convert 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_treegetchildrenremove)beautiful_soup_treer r childrenchildr r r r 3 s
r c K s |d u rt }t|drd|vrd|d<