Imported Upstream version 4.5.2
[platform/upstream/python-lxml.git] / doc / html / api / lxml.html.ElementSoup-pysrc.html
1 <?xml version="1.0" encoding="ascii"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3           "DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
6   <title>lxml.html.ElementSoup</title>
7   <link rel="stylesheet" href="epydoc.css" type="text/css" />
8   <script type="text/javascript" src="epydoc.js"></script>
9 </head>
10
11 <body bgcolor="white" text="black" link="blue" vlink="#204080"
12       alink="#204080">
13 <!-- ==================== NAVIGATION BAR ==================== -->
14 <table class="navbar" border="0" width="100%" cellpadding="0"
15        bgcolor="#a0c0ff" cellspacing="0">
16   <tr valign="middle">
17   <!-- Home link -->
18       <th>&nbsp;&nbsp;&nbsp;<a
19         href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21   <!-- Tree link -->
22       <th>&nbsp;&nbsp;&nbsp;<a
23         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25   <!-- Index link -->
26       <th>&nbsp;&nbsp;&nbsp;<a
27         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29   <!-- Help link -->
30       <th>&nbsp;&nbsp;&nbsp;<a
31         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33   <!-- Project homepage -->
34       <th class="navbar" align="right" width="100%">
35         <table border="0" cellpadding="0" cellspacing="0">
36           <tr><th class="navbar" align="center"
37             ><a class="navbar" target="_top" href="/">lxml API</a></th>
38           </tr></table></th>
39   </tr>
40 </table>
41 <table width="100%" cellpadding="0" cellspacing="0">
42   <tr valign="top">
43     <td width="100%">
44       <span class="breadcrumbs">
45         <a href="lxml-module.html">Package&nbsp;lxml</a> ::
46         <a href="lxml.html-module.html">Package&nbsp;html</a> ::
47         Module&nbsp;ElementSoup
48       </span>
49     </td>
50     <td>
51       <table cellpadding="0" cellspacing="0">
52         <!-- hide/show private -->
53         <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
54     onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
55         <tr><td align="right"><span class="options"
56             >[<a href="frames.html" target="_top">frames</a
57             >]&nbsp;|&nbsp;<a href="lxml.html.ElementSoup-pysrc.html"
58             target="_top">no&nbsp;frames</a>]</span></td></tr>
59       </table>
60     </td>
61   </tr>
62 </table>
63 <h1 class="epydoc">Source Code for <a href="lxml.html.ElementSoup-module.html">Module lxml.html.ElementSoup</a></h1>
64 <pre class="py-src">
65 <a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt id="link-0" class="py-name" targets="Variable lxml.html.ElementSoup.__doc__=lxml.html.ElementSoup-module.html#__doc__"><a title="lxml.html.ElementSoup.__doc__" class="py-name" href="#" onclick="return doclink('link-0', '__doc__', 'link-0');">__doc__</a></tt> <tt class="py-op">=</tt> <tt class="py-docstring">"""Legacy interface to the BeautifulSoup HTML parser.</tt> </tt>
66 <a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
67 <a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"> </tt>
68 <a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-name">__all__</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-string">"parse"</tt><tt class="py-op">,</tt> <tt class="py-string">"convert_tree"</tt><tt class="py-op">]</tt> </tt>
69 <a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"> </tt>
70 <a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-1" class="py-name" targets="Module lxml.html.soupparser=lxml.html.soupparser-module.html"><a title="lxml.html.soupparser" class="py-name" href="#" onclick="return doclink('link-1', 'soupparser', 'link-1');">soupparser</a></tt> <tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Function lxml.html.soupparser.convert_tree()=lxml.html.soupparser-module.html#convert_tree"><a title="lxml.html.soupparser.convert_tree" class="py-name" href="#" onclick="return doclink('link-2', 'convert_tree', 'link-2');">convert_tree</a></tt><tt class="py-op">,</tt> <tt id="link-3" class="py-name" targets="Method lxml.etree._ElementTree.parse()=lxml.etree._ElementTree-class.html#parse,Function lxml.etree.parse()=lxml.etree-module.html#parse,Function lxml.html.ElementSoup.parse()=lxml.html.ElementSoup-module.html#parse,Function lxml.html.html5parser.parse()=lxml.html.html5parser-module.html#parse,Function lxml.html.soupparser.parse()=lxml.html.soupparser-module.html#parse,Function lxml.objectify.parse()=lxml.objectify-module.html#parse,Method lxml.tests.common_imports.HelperTestCase.parse()=lxml.tests.common_imports.HelperTestCase-class.html#parse"><a title="lxml.etree._ElementTree.parse
71 lxml.etree.parse
72 lxml.html.ElementSoup.parse
73 lxml.html.html5parser.parse
74 lxml.html.soupparser.parse
75 lxml.objectify.parse
76 lxml.tests.common_imports.HelperTestCase.parse" class="py-name" href="#" onclick="return doclink('link-3', 'parse', 'link-3');">parse</a></tt> <tt class="py-keyword">as</tt> <tt id="link-4" class="py-name" targets="Function lxml.html.soupparser._parse()=lxml.html.soupparser-module.html#_parse"><a title="lxml.html.soupparser._parse" class="py-name" href="#" onclick="return doclink('link-4', '_parse', 'link-4');">_parse</a></tt> </tt>
77 <a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"> </tt>
78 <a name="parse"></a><div id="parse-def"><a name="L8"></a><tt class="py-lineno"> 8</tt> <a class="py-toggle" href="#" id="parse-toggle" onclick="return toggle('parse');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.html.ElementSoup-module.html#parse">parse</a><tt class="py-op">(</tt><tt class="py-param">file</tt><tt class="py-op">,</tt> <tt class="py-param">beautifulsoup</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">makeelement</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
79 </div><div id="parse-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="parse-expanded"><a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line">    <tt id="link-5" class="py-name" targets="Variable lxml.etree.iterparse.root=lxml.etree.iterparse-class.html#root"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-5', 'root', 'link-5');">root</a></tt> <tt class="py-op">=</tt> <tt id="link-6" class="py-name"><a title="lxml.html.soupparser._parse" class="py-name" href="#" onclick="return doclink('link-6', '_parse', 'link-4');">_parse</a></tt><tt class="py-op">(</tt><tt class="py-name">file</tt><tt class="py-op">,</tt> <tt class="py-name">beautifulsoup</tt><tt class="py-op">=</tt><tt class="py-name">beautifulsoup</tt><tt class="py-op">,</tt> <tt id="link-7" class="py-name" targets="Method lxml.etree._Element.makeelement()=lxml.etree._Element-class.html#makeelement,Method lxml.etree.iterparse.makeelement()=lxml.etree.iterparse-class.html#makeelement,Function lxml.tests.selftest2.makeelement()=lxml.tests.selftest2-module.html#makeelement"><a title="lxml.etree._Element.makeelement
80 lxml.etree.iterparse.makeelement
81 lxml.tests.selftest2.makeelement" class="py-name" href="#" onclick="return doclink('link-7', 'makeelement', 'link-7');">makeelement</a></tt><tt class="py-op">=</tt><tt id="link-8" class="py-name"><a title="lxml.etree._Element.makeelement
82 lxml.etree.iterparse.makeelement
83 lxml.tests.selftest2.makeelement" class="py-name" href="#" onclick="return doclink('link-8', 'makeelement', 'link-7');">makeelement</a></tt><tt class="py-op">)</tt> </tt>
84 <a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-9" class="py-name"><a title="lxml.etree.iterparse.root" class="py-name" href="#" onclick="return doclink('link-9', 'root', 'link-5');">root</a></tt><tt class="py-op">.</tt><tt id="link-10" class="py-name" targets="Method lxml.etree._ElementTree.getroot()=lxml.etree._ElementTree-class.html#getroot"><a title="lxml.etree._ElementTree.getroot" class="py-name" href="#" onclick="return doclink('link-10', 'getroot', 'link-10');">getroot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
85 </div><a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"> </tt><script type="text/javascript">
86 <!--
87 expandto(location.href);
88 // -->
89 </script>
90 </pre>
91 <br />
92 <!-- ==================== NAVIGATION BAR ==================== -->
93 <table class="navbar" border="0" width="100%" cellpadding="0"
94        bgcolor="#a0c0ff" cellspacing="0">
95   <tr valign="middle">
96   <!-- Home link -->
97       <th>&nbsp;&nbsp;&nbsp;<a
98         href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
99
100   <!-- Tree link -->
101       <th>&nbsp;&nbsp;&nbsp;<a
102         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
103
104   <!-- Index link -->
105       <th>&nbsp;&nbsp;&nbsp;<a
106         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
107
108   <!-- Help link -->
109       <th>&nbsp;&nbsp;&nbsp;<a
110         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
111
112   <!-- Project homepage -->
113       <th class="navbar" align="right" width="100%">
114         <table border="0" cellpadding="0" cellspacing="0">
115           <tr><th class="navbar" align="center"
116             ><a class="navbar" target="_top" href="/">lxml API</a></th>
117           </tr></table></th>
118   </tr>
119 </table>
120 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
121   <tr>
122     <td align="left" class="footer">
123     Generated by Epydoc 3.0.1
124     on Thu Jul  9 18:29:53 2020
125     </td>
126     <td align="right" class="footer">
127       <a target="mainFrame" href="http://epydoc.sourceforge.net"
128         >http://epydoc.sourceforge.net</a>
129     </td>
130   </tr>
131 </table>
132
133 <script type="text/javascript">
134   <!--
135   // Private objects are initially displayed (because if
136   // javascript is turned off then we want them to be
137   // visible); but by default, we want to hide them.  So hide
138   // them unless we have a cookie that says to show them.
139   checkCookie();
140   // -->
141 </script>
142 </body>
143 </html>