89eebd04ad4f51e23b90a42aa6509b4ef474fef5
[platform/upstream/python-lxml.git] / doc / html / api / lxml.html.HtmlElement-class.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.HtmlElement</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         lxml ::
46         html ::
47         HtmlElement ::
48         Class&nbsp;HtmlElement
49       </span>
50     </td>
51     <td>
52       <table cellpadding="0" cellspacing="0">
53         <!-- hide/show private -->
54         <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
55     onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
56         <tr><td align="right"><span class="options"
57             >[<a href="frames.html" target="_top">frames</a
58             >]&nbsp;|&nbsp;<a href="lxml.html.HtmlElement-class.html"
59             target="_top">no&nbsp;frames</a>]</span></td></tr>
60       </table>
61     </td>
62   </tr>
63 </table>
64 <!-- ==================== CLASS DESCRIPTION ==================== -->
65 <h1 class="epydoc">Class HtmlElement</h1><p class="nomargin-top"><span class="codelink"><a href="lxml.html-pysrc.html#HtmlElement">source&nbsp;code</a></span></p>
66 <pre class="base-tree">
67     object --+        
68              |        
69 <a href="lxml.etree._Element-class.html" onclick="show_private();">etree._Element</a> --+    
70                  |    
71  <a href="lxml.etree.ElementBase-class.html">etree.ElementBase</a> --+
72                      |
73         object --+   |
74                  |   |
75          <a href="lxml.html.HtmlMixin-class.html">HtmlMixin</a> --+
76                      |
77                     <strong class="uidshort">HtmlElement</strong>
78 </pre>
79
80 <dl><dt>Known Subclasses:</dt>
81 <dd>
82       <ul class="subclass-list">
83 <li><a href="lxml.html.FormElement-class.html">FormElement</a></li><li>, <a href="lxml.html.InputElement-class.html">InputElement</a></li><li>, <a href="lxml.html.LabelElement-class.html">LabelElement</a></li><li>, <a href="lxml.html.SelectElement-class.html">SelectElement</a></li><li>, <a href="lxml.html.TextareaElement-class.html">TextareaElement</a></li>  </ul>
84 </dd></dl>
85
86 <hr />
87 <!-- ==================== INSTANCE METHODS ==================== -->
88 <a name="section-InstanceMethods"></a>
89 <table class="summary" border="1" cellpadding="3"
90        cellspacing="0" width="100%" bgcolor="white">
91 <tr bgcolor="#70b0f0" class="table-header">
92   <td colspan="2" class="table-header">
93     <table border="0" cellpadding="0" cellspacing="0" width="100%">
94       <tr valign="top">
95         <td align="left"><span class="table-header">Instance Methods</span></td>
96         <td align="right" valign="top"
97          ><span class="options">[<a href="#section-InstanceMethods"
98          class="privatelink" onclick="toggle_private();"
99          >hide private</a>]</span></td>
100       </tr>
101     </table>
102   </td>
103 </tr>
104 <tr>
105     <td width="15%" align="right" valign="top" class="summary">
106       <span class="summary-type">&nbsp;</span>
107     </td><td class="summary">
108       <table width="100%" cellpadding="0" cellspacing="0" border="0">
109         <tr>
110           <td><span class="summary-sig"><a href="lxml.html.HtmlElement-class.html#cssselect" class="summary-sig-name">cssselect</a>(<span class="summary-sig-arg">self</span>,
111         <span class="summary-sig-arg">expr</span>,
112         <span class="summary-sig-arg">translator</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">html</code><code class="variable-quote">'</code></span>)</span><br />
113       Run the CSS expression on this element and its children,
114 returning a list of the results.</td>
115           <td align="right" valign="top">
116             <span class="codelink"><a href="lxml.html-pysrc.html#HtmlElement.cssselect">source&nbsp;code</a></span>
117             
118           </td>
119         </tr>
120       </table>
121       
122     </td>
123   </tr>
124 <tr>
125     <td width="15%" align="right" valign="top" class="summary">
126       <span class="summary-type">&nbsp;</span>
127     </td><td class="summary">
128       <table width="100%" cellpadding="0" cellspacing="0" border="0">
129         <tr>
130           <td><span class="summary-sig"><a href="lxml.html.HtmlElement-class.html#set" class="summary-sig-name">set</a>(<span class="summary-sig-arg">self</span>,
131         <span class="summary-sig-arg">key</span>,
132         <span class="summary-sig-arg">value</span>=<span class="summary-sig-default">None</span>)</span><br />
133       Sets an element attribute.  If no value is provided, or if the value is None,
134 creates a 'boolean' attribute without value, e.g. &quot;&lt;form novalidate&gt;&lt;/form&gt;&quot;
135 for <tt class="rst-docutils literal"><span class="pre">form.set('novalidate')</span></tt>.</td>
136           <td align="right" valign="top">
137             <span class="codelink"><a href="lxml.html-pysrc.html#HtmlElement.set">source&nbsp;code</a></span>
138             
139           </td>
140         </tr>
141       </table>
142       
143     </td>
144   </tr>
145   <tr>
146     <td colspan="2" class="summary">
147     <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree.ElementBase-class.html">etree.ElementBase</a></code></b>:
148       <code><a href="lxml.etree.ElementBase-class.html#__init__">__init__</a></code>,
149       <code><a href="lxml.etree.ElementBase-class.html#__new__">__new__</a></code>
150       </p>
151     <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree._Element-class.html" onclick="show_private();">etree._Element</a></code></b>:
152       <code><a href="lxml.etree._Element-class.html#__contains__">__contains__</a></code>,
153       <code><a href="lxml.etree._Element-class.html#__copy__">__copy__</a></code>,
154       <code><a href="lxml.etree._Element-class.html#__deepcopy__">__deepcopy__</a></code>,
155       <code><a href="lxml.etree._Element-class.html#__delitem__">__delitem__</a></code>,
156       <code><a href="lxml.etree._Element-class.html#__getitem__">__getitem__</a></code>,
157       <code><a href="lxml.etree._Element-class.html#__iter__">__iter__</a></code>,
158       <code><a href="lxml.etree._Element-class.html#__len__">__len__</a></code>,
159       <code><a href="lxml.etree._Element-class.html#__nonzero__">__nonzero__</a></code>,
160       <code><a href="lxml.etree._Element-class.html#__repr__">__repr__</a></code>,
161       <code><a href="lxml.etree._Element-class.html#__reversed__">__reversed__</a></code>,
162       <code><a href="lxml.etree._Element-class.html#__setitem__">__setitem__</a></code>,
163       <code><a href="lxml.etree._Element-class.html#addnext">addnext</a></code>,
164       <code><a href="lxml.etree._Element-class.html#addprevious">addprevious</a></code>,
165       <code><a href="lxml.etree._Element-class.html#append">append</a></code>,
166       <code><a href="lxml.etree._Element-class.html#clear">clear</a></code>,
167       <code><a href="lxml.etree._Element-class.html#extend">extend</a></code>,
168       <code><a href="lxml.etree._Element-class.html#find">find</a></code>,
169       <code><a href="lxml.etree._Element-class.html#findall">findall</a></code>,
170       <code><a href="lxml.etree._Element-class.html#findtext">findtext</a></code>,
171       <code><a href="lxml.etree._Element-class.html#get">get</a></code>,
172       <code><a href="lxml.etree._Element-class.html#getchildren">getchildren</a></code>,
173       <code><a href="lxml.etree._Element-class.html#getiterator">getiterator</a></code>,
174       <code><a href="lxml.etree._Element-class.html#getnext">getnext</a></code>,
175       <code><a href="lxml.etree._Element-class.html#getparent">getparent</a></code>,
176       <code><a href="lxml.etree._Element-class.html#getprevious">getprevious</a></code>,
177       <code><a href="lxml.etree._Element-class.html#getroottree">getroottree</a></code>,
178       <code><a href="lxml.etree._Element-class.html#index">index</a></code>,
179       <code><a href="lxml.etree._Element-class.html#insert">insert</a></code>,
180       <code><a href="lxml.etree._Element-class.html#items">items</a></code>,
181       <code><a href="lxml.etree._Element-class.html#iter">iter</a></code>,
182       <code><a href="lxml.etree._Element-class.html#iterancestors">iterancestors</a></code>,
183       <code><a href="lxml.etree._Element-class.html#iterchildren">iterchildren</a></code>,
184       <code><a href="lxml.etree._Element-class.html#iterdescendants">iterdescendants</a></code>,
185       <code><a href="lxml.etree._Element-class.html#iterfind">iterfind</a></code>,
186       <code><a href="lxml.etree._Element-class.html#itersiblings">itersiblings</a></code>,
187       <code><a href="lxml.etree._Element-class.html#itertext">itertext</a></code>,
188       <code><a href="lxml.etree._Element-class.html#keys">keys</a></code>,
189       <code><a href="lxml.etree._Element-class.html#makeelement">makeelement</a></code>,
190       <code><a href="lxml.etree._Element-class.html#remove">remove</a></code>,
191       <code><a href="lxml.etree._Element-class.html#replace">replace</a></code>,
192       <code><a href="lxml.etree._Element-class.html#values">values</a></code>,
193       <code><a href="lxml.etree._Element-class.html#xpath">xpath</a></code>
194       </p>
195     <div class="private">    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree._Element-class.html" onclick="show_private();">etree._Element</a></code></b> (private):
196       <code><a href="lxml.etree._Element-class.html#_init" onclick="show_private();">_init</a></code>
197       </p></div>
198     <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.html.HtmlMixin-class.html">HtmlMixin</a></code></b>:
199       <code><a href="lxml.html.HtmlMixin-class.html#drop_tag">drop_tag</a></code>,
200       <code><a href="lxml.html.HtmlMixin-class.html#drop_tree">drop_tree</a></code>,
201       <code><a href="lxml.html.HtmlMixin-class.html#find_class">find_class</a></code>,
202       <code><a href="lxml.html.HtmlMixin-class.html#find_rel_links">find_rel_links</a></code>,
203       <code><a href="lxml.html.HtmlMixin-class.html#get_element_by_id">get_element_by_id</a></code>,
204       <code><a href="lxml.html.HtmlMixin-class.html#iterlinks">iterlinks</a></code>,
205       <code><a href="lxml.html.HtmlMixin-class.html#make_links_absolute">make_links_absolute</a></code>,
206       <code><a href="lxml.html.HtmlMixin-class.html#resolve_base_href">resolve_base_href</a></code>,
207       <code><a href="lxml.html.HtmlMixin-class.html#rewrite_links">rewrite_links</a></code>,
208       <code><a href="lxml.html.HtmlMixin-class.html#text_content">text_content</a></code>
209       </p>
210     <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
211       <code>__delattr__</code>,
212       <code>__format__</code>,
213       <code>__getattribute__</code>,
214       <code>__hash__</code>,
215       <code>__reduce__</code>,
216       <code>__reduce_ex__</code>,
217       <code>__setattr__</code>,
218       <code>__sizeof__</code>,
219       <code>__str__</code>,
220       <code>__subclasshook__</code>
221       </p>
222     </td>
223   </tr>
224 </table>
225 <!-- ==================== PROPERTIES ==================== -->
226 <a name="section-Properties"></a>
227 <table class="summary" border="1" cellpadding="3"
228        cellspacing="0" width="100%" bgcolor="white">
229 <tr bgcolor="#70b0f0" class="table-header">
230   <td colspan="2" class="table-header">
231     <table border="0" cellpadding="0" cellspacing="0" width="100%">
232       <tr valign="top">
233         <td align="left"><span class="table-header">Properties</span></td>
234         <td align="right" valign="top"
235          ><span class="options">[<a href="#section-Properties"
236          class="privatelink" onclick="toggle_private();"
237          >hide private</a>]</span></td>
238       </tr>
239     </table>
240   </td>
241 </tr>
242   <tr>
243     <td colspan="2" class="summary">
244     <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.etree._Element-class.html" onclick="show_private();">etree._Element</a></code></b>:
245       <code><a href="lxml.etree._Element-class.html#attrib">attrib</a></code>,
246       <code><a href="lxml.etree._Element-class.html#base">base</a></code>,
247       <code><a href="lxml.etree._Element-class.html#nsmap">nsmap</a></code>,
248       <code><a href="lxml.etree._Element-class.html#prefix">prefix</a></code>,
249       <code><a href="lxml.etree._Element-class.html#sourceline">sourceline</a></code>,
250       <code><a href="lxml.etree._Element-class.html#tag">tag</a></code>,
251       <code><a href="lxml.etree._Element-class.html#tail">tail</a></code>,
252       <code><a href="lxml.etree._Element-class.html#text">text</a></code>
253       </p>
254     <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.html.HtmlMixin-class.html">HtmlMixin</a></code></b>:
255       <code><a href="lxml.html.HtmlMixin-class.html#base_url">base_url</a></code>,
256       <code><a href="lxml.html.HtmlMixin-class.html#body">body</a></code>,
257       <code><a href="lxml.html.HtmlMixin-class.html#classes">classes</a></code>,
258       <code><a href="lxml.html.HtmlMixin-class.html#forms">forms</a></code>,
259       <code><a href="lxml.html.HtmlMixin-class.html#head">head</a></code>,
260       <code><a href="lxml.html.HtmlMixin-class.html#label">label</a></code>
261       </p>
262     <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
263       <code>__class__</code>
264       </p>
265     </td>
266   </tr>
267 </table>
268 <!-- ==================== METHOD DETAILS ==================== -->
269 <a name="section-MethodDetails"></a>
270 <table class="details" border="1" cellpadding="3"
271        cellspacing="0" width="100%" bgcolor="white">
272 <tr bgcolor="#70b0f0" class="table-header">
273   <td colspan="2" class="table-header">
274     <table border="0" cellpadding="0" cellspacing="0" width="100%">
275       <tr valign="top">
276         <td align="left"><span class="table-header">Method Details</span></td>
277         <td align="right" valign="top"
278          ><span class="options">[<a href="#section-MethodDetails"
279          class="privatelink" onclick="toggle_private();"
280          >hide private</a>]</span></td>
281       </tr>
282     </table>
283   </td>
284 </tr>
285 </table>
286 <a name="cssselect"></a>
287 <div>
288 <table class="details" border="1" cellpadding="3"
289        cellspacing="0" width="100%" bgcolor="white">
290 <tr><td>
291   <table width="100%" cellpadding="0" cellspacing="0" border="0">
292   <tr valign="top"><td>
293   <h3 class="epydoc"><span class="sig"><span class="sig-name">cssselect</span>(<span class="sig-arg">self</span>,
294         <span class="sig-arg">expr</span>,
295         <span class="sig-arg">translator</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">html</code><code class="variable-quote">'</code></span>)</span>
296   </h3>
297   </td><td align="right" valign="top"
298     ><span class="codelink"><a href="lxml.html-pysrc.html#HtmlElement.cssselect">source&nbsp;code</a></span>&nbsp;
299     </td>
300   </tr></table>
301   
302   <p>Run the CSS expression on this element and its children,
303 returning a list of the results.</p>
304 <p>Equivalent to lxml.cssselect.CSSSelect(expr, translator='html')(self)
305 -- note that pre-compiling the expression can provide a substantial
306 speedup.</p>
307   <dl class="fields">
308     <dt>Overrides:
309         <a href="lxml.html.HtmlMixin-class.html#cssselect">HtmlMixin.cssselect</a>
310     </dt>
311   </dl>
312 </td></tr></table>
313 </div>
314 <a name="set"></a>
315 <div>
316 <table class="details" border="1" cellpadding="3"
317        cellspacing="0" width="100%" bgcolor="white">
318 <tr><td>
319   <table width="100%" cellpadding="0" cellspacing="0" border="0">
320   <tr valign="top"><td>
321   <h3 class="epydoc"><span class="sig"><span class="sig-name">set</span>(<span class="sig-arg">self</span>,
322         <span class="sig-arg">key</span>,
323         <span class="sig-arg">value</span>=<span class="sig-default">None</span>)</span>
324   </h3>
325   </td><td align="right" valign="top"
326     ><span class="codelink"><a href="lxml.html-pysrc.html#HtmlElement.set">source&nbsp;code</a></span>&nbsp;
327     </td>
328   </tr></table>
329   
330   Sets an element attribute.  If no value is provided, or if the value is None,
331 creates a 'boolean' attribute without value, e.g. &quot;&lt;form novalidate&gt;&lt;/form&gt;&quot;
332 for <tt class="rst-docutils literal"><span class="pre">form.set('novalidate')</span></tt>.
333   <dl class="fields">
334     <dt>Overrides:
335         <a href="lxml.html.HtmlMixin-class.html#set">HtmlMixin.set</a>
336     </dt>
337   </dl>
338 </td></tr></table>
339 </div>
340 <br />
341 <!-- ==================== NAVIGATION BAR ==================== -->
342 <table class="navbar" border="0" width="100%" cellpadding="0"
343        bgcolor="#a0c0ff" cellspacing="0">
344   <tr valign="middle">
345   <!-- Home link -->
346       <th>&nbsp;&nbsp;&nbsp;<a
347         href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
348
349   <!-- Tree link -->
350       <th>&nbsp;&nbsp;&nbsp;<a
351         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
352
353   <!-- Index link -->
354       <th>&nbsp;&nbsp;&nbsp;<a
355         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
356
357   <!-- Help link -->
358       <th>&nbsp;&nbsp;&nbsp;<a
359         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
360
361   <!-- Project homepage -->
362       <th class="navbar" align="right" width="100%">
363         <table border="0" cellpadding="0" cellspacing="0">
364           <tr><th class="navbar" align="center"
365             ><a class="navbar" target="_top" href="/">lxml API</a></th>
366           </tr></table></th>
367   </tr>
368 </table>
369 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
370   <tr>
371     <td align="left" class="footer">
372     Generated by Epydoc 3.0.1
373     on Wed Jan 29 12:26:21 2020
374     </td>
375     <td align="right" class="footer">
376       <a target="mainFrame" href="http://epydoc.sourceforge.net"
377         >http://epydoc.sourceforge.net</a>
378     </td>
379   </tr>
380 </table>
381
382 <script type="text/javascript">
383   <!--
384   // Private objects are initially displayed (because if
385   // javascript is turned off then we want them to be
386   // visible); but by default, we want to hide them.  So hide
387   // them unless we have a cookie that says to show them.
388   checkCookie();
389   // -->
390 </script>
391 </body>
392 </html>