Ñò
žªJc @ sÜ d Z d d d g Z d d k l Z l Z d d k l Z l Z l Z l Z l Z d d d „ Z d d d „ Z d d „ Z
d
„ Z d „ Z d „ Z d
„ Z d d k l Z d d k Z e i d ƒ i Z d „ Z d S( s5 External interface to the BeautifulSoup HTML parser.
t
fromstringt parset convert_treeiÿÿÿÿ( t etreet html( t
BeautifulSoupt Tagt Commentt ProcessingInstructiont NavigableStringc K s t | | | | S( s¤ 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.
( t _parse( t datat
beautifulsoupt makeelementt bsargs( ( s: /usr/lib64/python2.6/site-packages/lxml/html/soupparser.pyR s c K sB t | d ƒ p t | ƒ } n t | | | | } t i | ƒ S( sY 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.
t read( t hasattrt openR
R t ElementTree( t fileR R
R t root( ( s: /usr/lib64/python2.6/site-packages/lxml/html/soupparser.pyR s c C sZ | d j o t i i } n t | | ƒ } | i ƒ } x | D] } | i | ƒ q? W| S( s 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.
N( t NoneR t html_parserR
t
_convert_treet getchildrent remove( t beautiful_soup_treeR
R t childrent child( ( s: /usr/lib64/python2.6/site-packages/lxml/html/soupparser.pyR ' s
c K sª | d j o
t } n | d j o t i i } n d | j o d | d