ó ÕöePc@sdZdddgZddlmZmZddlmZmZmZmZm Z ddd„Z ddd„Z dd „Z d „Zd „Zd „Zd „ZyddlmZWn!ek rØddlmZnXddlZejdƒjZd„ZdS(s5External interface to the BeautifulSoup HTML parser. t fromstringtparset convert_treeiÿÿÿÿ(tetreethtml(t BeautifulSouptTagtCommenttProcessingInstructiontNavigableStringcKst||||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(tdatat beautifulsoupt makeelementtbsargs((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyR s cKs@t|dƒst|ƒ}nt||||}tj|ƒS(sYParse 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. tread(thasattrtopenR Rt ElementTree(tfileR R Rtroot((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyRs cCsX|dkrtjj}nt||ƒ}|jƒ}x|D]}|j|ƒq=W|S(sConvert 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(tNoneRt html_parserR t _convert_treet getchildrentremove(tbeautiful_soup_treeR Rtchildrentchild((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyR's   cKs¡|dkrt}n|dkr0tjj}nd|krId|ds"(