a3b1096f1fbe21533f4219526c792e5c6dc3faf6
[platform/upstream/python-lxml.git] / doc / html / api / lxml.etree._Element-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.etree._Element</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.etree-module.html">Module&nbsp;etree</a> ::
47         Class&nbsp;_Element
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.etree._Element-class.html"
58             target="_top">no&nbsp;frames</a>]</span></td></tr>
59       </table>
60     </td>
61   </tr>
62 </table>
63 <!-- ==================== CLASS DESCRIPTION ==================== -->
64 <h1 class="epydoc">Class _Element</h1><p class="nomargin-top"></p>
65 <pre class="base-tree">
66 object --+
67          |
68         <strong class="uidshort">_Element</strong>
69 </pre>
70
71 <dl><dt>Known Subclasses:</dt>
72 <dd>
73       <ul class="subclass-list">
74 <li><a href="lxml.etree.ElementBase-class.html">ElementBase</a></li><li>, <i>unreachable</i>.__ContentOnlyElement</li>  </ul>
75 </dd></dl>
76
77 <hr />
78 <p>Element class.</p>
79 <p>References a document object and a libxml node.</p>
80 <p>By pointing to a Document instance, a reference is kept to
81 _Document as long as there is some pointer to a node in it.</p>
82
83 <!-- ==================== INSTANCE METHODS ==================== -->
84 <a name="section-InstanceMethods"></a>
85 <table class="summary" border="1" cellpadding="3"
86        cellspacing="0" width="100%" bgcolor="white">
87 <tr bgcolor="#70b0f0" class="table-header">
88   <td colspan="2" class="table-header">
89     <table border="0" cellpadding="0" cellspacing="0" width="100%">
90       <tr valign="top">
91         <td align="left"><span class="table-header">Instance Methods</span></td>
92         <td align="right" valign="top"
93          ><span class="options">[<a href="#section-InstanceMethods"
94          class="privatelink" onclick="toggle_private();"
95          >hide private</a>]</span></td>
96       </tr>
97     </table>
98   </td>
99 </tr>
100 <tr>
101     <td width="15%" align="right" valign="top" class="summary">
102       <span class="summary-type">&nbsp;</span>
103     </td><td class="summary">
104       <table width="100%" cellpadding="0" cellspacing="0" border="0">
105         <tr>
106           <td><span class="summary-sig"><a name="__contains__"></a><span class="summary-sig-name">__contains__</span>(<span class="summary-sig-arg">self</span>,
107         <span class="summary-sig-arg">element</span>)</span></td>
108           <td align="right" valign="top">
109             
110             
111           </td>
112         </tr>
113       </table>
114       
115     </td>
116   </tr>
117 <tr>
118     <td width="15%" align="right" valign="top" class="summary">
119       <span class="summary-type">&nbsp;</span>
120     </td><td class="summary">
121       <table width="100%" cellpadding="0" cellspacing="0" border="0">
122         <tr>
123           <td><span class="summary-sig"><a name="__copy__"></a><span class="summary-sig-name">__copy__</span>(<span class="summary-sig-arg">self</span>)</span></td>
124           <td align="right" valign="top">
125             
126             
127           </td>
128         </tr>
129       </table>
130       
131     </td>
132   </tr>
133 <tr>
134     <td width="15%" align="right" valign="top" class="summary">
135       <span class="summary-type">&nbsp;</span>
136     </td><td class="summary">
137       <table width="100%" cellpadding="0" cellspacing="0" border="0">
138         <tr>
139           <td><span class="summary-sig"><a name="__deepcopy__"></a><span class="summary-sig-name">__deepcopy__</span>(<span class="summary-sig-arg">self</span>,
140         <span class="summary-sig-arg">memo</span>)</span></td>
141           <td align="right" valign="top">
142             
143             
144           </td>
145         </tr>
146       </table>
147       
148     </td>
149   </tr>
150 <tr>
151     <td width="15%" align="right" valign="top" class="summary">
152       <span class="summary-type">&nbsp;</span>
153     </td><td class="summary">
154       <table width="100%" cellpadding="0" cellspacing="0" border="0">
155         <tr>
156           <td><span class="summary-sig"><a name="__delitem__"></a><span class="summary-sig-name">__delitem__</span>(<span class="summary-sig-arg">self</span>,
157         <span class="summary-sig-arg">x</span>)</span><br />
158       Deletes the given subelement or a slice.</td>
159           <td align="right" valign="top">
160             
161             
162           </td>
163         </tr>
164       </table>
165       
166     </td>
167   </tr>
168 <tr>
169     <td width="15%" align="right" valign="top" class="summary">
170       <span class="summary-type">&nbsp;</span>
171     </td><td class="summary">
172       <table width="100%" cellpadding="0" cellspacing="0" border="0">
173         <tr>
174           <td><span class="summary-sig"><a name="__getitem__"></a><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-arg">...</span>)</span><br />
175       Returns the subelement at the given position or the requested
176 slice.</td>
177           <td align="right" valign="top">
178             
179             
180           </td>
181         </tr>
182       </table>
183       
184     </td>
185   </tr>
186 <tr>
187     <td width="15%" align="right" valign="top" class="summary">
188       <span class="summary-type">&nbsp;</span>
189     </td><td class="summary">
190       <table width="100%" cellpadding="0" cellspacing="0" border="0">
191         <tr>
192           <td><span class="summary-sig"><a name="__iter__"></a><span class="summary-sig-name">__iter__</span>(<span class="summary-sig-arg">self</span>)</span></td>
193           <td align="right" valign="top">
194             
195             
196           </td>
197         </tr>
198       </table>
199       
200     </td>
201   </tr>
202 <tr>
203     <td width="15%" align="right" valign="top" class="summary">
204       <span class="summary-type">&nbsp;</span>
205     </td><td class="summary">
206       <table width="100%" cellpadding="0" cellspacing="0" border="0">
207         <tr>
208           <td><span class="summary-sig"><a name="__len__"></a><span class="summary-sig-name">__len__</span>(<span class="summary-sig-arg">self</span>)</span><br />
209       Returns the number of subelements.</td>
210           <td align="right" valign="top">
211             
212             
213           </td>
214         </tr>
215       </table>
216       
217     </td>
218   </tr>
219 <tr>
220     <td width="15%" align="right" valign="top" class="summary">
221       <span class="summary-type">a new object with type S, a subtype of T</span>
222     </td><td class="summary">
223       <table width="100%" cellpadding="0" cellspacing="0" border="0">
224         <tr>
225           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#__new__" class="summary-sig-name">__new__</a>(<span class="summary-sig-arg">T</span>,
226         <span class="summary-sig-arg">S</span>,
227         <span class="summary-sig-arg">...</span>)</span></td>
228           <td align="right" valign="top">
229             
230             
231           </td>
232         </tr>
233       </table>
234       
235     </td>
236   </tr>
237 <tr>
238     <td width="15%" align="right" valign="top" class="summary">
239       <span class="summary-type">&nbsp;</span>
240     </td><td class="summary">
241       <table width="100%" cellpadding="0" cellspacing="0" border="0">
242         <tr>
243           <td><span class="summary-sig"><a name="__nonzero__"></a><span class="summary-sig-name">__nonzero__</span>(<span class="summary-sig-arg">x</span>)</span><br />
244       x != 0</td>
245           <td align="right" valign="top">
246             
247             
248           </td>
249         </tr>
250       </table>
251       
252     </td>
253   </tr>
254 <tr>
255     <td width="15%" align="right" valign="top" class="summary">
256       <span class="summary-type">&nbsp;</span>
257     </td><td class="summary">
258       <table width="100%" cellpadding="0" cellspacing="0" border="0">
259         <tr>
260           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#__repr__" class="summary-sig-name">__repr__</a>(<span class="summary-sig-arg">self</span>)</span><br />
261       repr(x)</td>
262           <td align="right" valign="top">
263             
264             
265           </td>
266         </tr>
267       </table>
268       
269     </td>
270   </tr>
271 <tr>
272     <td width="15%" align="right" valign="top" class="summary">
273       <span class="summary-type">&nbsp;</span>
274     </td><td class="summary">
275       <table width="100%" cellpadding="0" cellspacing="0" border="0">
276         <tr>
277           <td><span class="summary-sig"><a name="__reversed__"></a><span class="summary-sig-name">__reversed__</span>(<span class="summary-sig-arg">self</span>)</span></td>
278           <td align="right" valign="top">
279             
280             
281           </td>
282         </tr>
283       </table>
284       
285     </td>
286   </tr>
287 <tr>
288     <td width="15%" align="right" valign="top" class="summary">
289       <span class="summary-type">&nbsp;</span>
290     </td><td class="summary">
291       <table width="100%" cellpadding="0" cellspacing="0" border="0">
292         <tr>
293           <td><span class="summary-sig"><a name="__setitem__"></a><span class="summary-sig-name">__setitem__</span>(<span class="summary-sig-arg">self</span>,
294         <span class="summary-sig-arg">x</span>,
295         <span class="summary-sig-arg">value</span>)</span><br />
296       Replaces the given subelement index or slice.</td>
297           <td align="right" valign="top">
298             
299             
300           </td>
301         </tr>
302       </table>
303       
304     </td>
305   </tr>
306 <tr class="private">
307     <td width="15%" align="right" valign="top" class="summary">
308       <span class="summary-type">&nbsp;</span>
309     </td><td class="summary">
310       <table width="100%" cellpadding="0" cellspacing="0" border="0">
311         <tr>
312           <td><span class="summary-sig"><a name="_init"></a><span class="summary-sig-name">_init</span>(<span class="summary-sig-arg">self</span>)</span><br />
313       Called after object initialisation.  Custom subclasses may override
314 this if they recursively call _init() in the superclasses.</td>
315           <td align="right" valign="top">
316             
317             
318           </td>
319         </tr>
320       </table>
321       
322     </td>
323   </tr>
324 <tr>
325     <td width="15%" align="right" valign="top" class="summary">
326       <span class="summary-type">&nbsp;</span>
327     </td><td class="summary">
328       <table width="100%" cellpadding="0" cellspacing="0" border="0">
329         <tr>
330           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#addnext" class="summary-sig-name">addnext</a>(<span class="summary-sig-arg">self</span>,
331         <span class="summary-sig-arg">element</span>)</span><br />
332       Adds the element as a following sibling directly after this
333 element.</td>
334           <td align="right" valign="top">
335             
336             
337           </td>
338         </tr>
339       </table>
340       
341     </td>
342   </tr>
343 <tr>
344     <td width="15%" align="right" valign="top" class="summary">
345       <span class="summary-type">&nbsp;</span>
346     </td><td class="summary">
347       <table width="100%" cellpadding="0" cellspacing="0" border="0">
348         <tr>
349           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#addprevious" class="summary-sig-name">addprevious</a>(<span class="summary-sig-arg">self</span>,
350         <span class="summary-sig-arg">element</span>)</span><br />
351       Adds the element as a preceding sibling directly before this
352 element.</td>
353           <td align="right" valign="top">
354             
355             
356           </td>
357         </tr>
358       </table>
359       
360     </td>
361   </tr>
362 <tr>
363     <td width="15%" align="right" valign="top" class="summary">
364       <span class="summary-type">&nbsp;</span>
365     </td><td class="summary">
366       <table width="100%" cellpadding="0" cellspacing="0" border="0">
367         <tr>
368           <td><span class="summary-sig"><a name="append"></a><span class="summary-sig-name">append</span>(<span class="summary-sig-arg">self</span>,
369         <span class="summary-sig-arg">element</span>)</span><br />
370       Adds a subelement to the end of this element.</td>
371           <td align="right" valign="top">
372             
373             
374           </td>
375         </tr>
376       </table>
377       
378     </td>
379   </tr>
380 <tr>
381     <td width="15%" align="right" valign="top" class="summary">
382       <span class="summary-type">&nbsp;</span>
383     </td><td class="summary">
384       <table width="100%" cellpadding="0" cellspacing="0" border="0">
385         <tr>
386           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#clear" class="summary-sig-name">clear</a>(<span class="summary-sig-arg">self</span>,
387         <span class="summary-sig-arg">keep_tail</span>=<span class="summary-sig-default">False</span>)</span><br />
388       Resets an element.  This function removes all subelements, clears
389 all attributes and sets the text and tail properties to None.</td>
390           <td align="right" valign="top">
391             
392             
393           </td>
394         </tr>
395       </table>
396       
397     </td>
398   </tr>
399 <tr>
400     <td width="15%" align="right" valign="top" class="summary">
401       <span class="summary-type">&nbsp;</span>
402     </td><td class="summary">
403       <table width="100%" cellpadding="0" cellspacing="0" border="0">
404         <tr>
405           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#cssselect" class="summary-sig-name">cssselect</a>(<span class="summary-sig-arg">...</span>)</span><br />
406       Run the CSS expression on this element and its children,
407 returning a list of the results.</td>
408           <td align="right" valign="top">
409             
410             
411           </td>
412         </tr>
413       </table>
414       
415     </td>
416   </tr>
417 <tr>
418     <td width="15%" align="right" valign="top" class="summary">
419       <span class="summary-type">&nbsp;</span>
420     </td><td class="summary">
421       <table width="100%" cellpadding="0" cellspacing="0" border="0">
422         <tr>
423           <td><span class="summary-sig"><a name="extend"></a><span class="summary-sig-name">extend</span>(<span class="summary-sig-arg">self</span>,
424         <span class="summary-sig-arg">elements</span>)</span><br />
425       Extends the current children by the elements in the iterable.</td>
426           <td align="right" valign="top">
427             
428             
429           </td>
430         </tr>
431       </table>
432       
433     </td>
434   </tr>
435 <tr>
436     <td width="15%" align="right" valign="top" class="summary">
437       <span class="summary-type">&nbsp;</span>
438     </td><td class="summary">
439       <table width="100%" cellpadding="0" cellspacing="0" border="0">
440         <tr>
441           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#find" class="summary-sig-name">find</a>(<span class="summary-sig-arg">self</span>,
442         <span class="summary-sig-arg">path</span>,
443         <span class="summary-sig-arg">namespaces</span>=<span class="summary-sig-default">None</span>)</span><br />
444       Finds the first matching subelement, by tag name or path.</td>
445           <td align="right" valign="top">
446             
447             
448           </td>
449         </tr>
450       </table>
451       
452     </td>
453   </tr>
454 <tr>
455     <td width="15%" align="right" valign="top" class="summary">
456       <span class="summary-type">&nbsp;</span>
457     </td><td class="summary">
458       <table width="100%" cellpadding="0" cellspacing="0" border="0">
459         <tr>
460           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#findall" class="summary-sig-name">findall</a>(<span class="summary-sig-arg">self</span>,
461         <span class="summary-sig-arg">path</span>,
462         <span class="summary-sig-arg">namespaces</span>=<span class="summary-sig-default">None</span>)</span><br />
463       Finds all matching subelements, by tag name or path.</td>
464           <td align="right" valign="top">
465             
466             
467           </td>
468         </tr>
469       </table>
470       
471     </td>
472   </tr>
473 <tr>
474     <td width="15%" align="right" valign="top" class="summary">
475       <span class="summary-type">&nbsp;</span>
476     </td><td class="summary">
477       <table width="100%" cellpadding="0" cellspacing="0" border="0">
478         <tr>
479           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#findtext" class="summary-sig-name">findtext</a>(<span class="summary-sig-arg">self</span>,
480         <span class="summary-sig-arg">path</span>,
481         <span class="summary-sig-arg">default</span>=<span class="summary-sig-default">None</span>,
482         <span class="summary-sig-arg">namespaces</span>=<span class="summary-sig-default">None</span>)</span><br />
483       Finds text for the first matching subelement, by tag name or path.</td>
484           <td align="right" valign="top">
485             
486             
487           </td>
488         </tr>
489       </table>
490       
491     </td>
492   </tr>
493 <tr>
494     <td width="15%" align="right" valign="top" class="summary">
495       <span class="summary-type">&nbsp;</span>
496     </td><td class="summary">
497       <table width="100%" cellpadding="0" cellspacing="0" border="0">
498         <tr>
499           <td><span class="summary-sig"><a name="get"></a><span class="summary-sig-name">get</span>(<span class="summary-sig-arg">self</span>,
500         <span class="summary-sig-arg">key</span>,
501         <span class="summary-sig-arg">default</span>=<span class="summary-sig-default">None</span>)</span><br />
502       Gets an element attribute.</td>
503           <td align="right" valign="top">
504             
505             
506           </td>
507         </tr>
508       </table>
509       
510     </td>
511   </tr>
512 <tr>
513     <td width="15%" align="right" valign="top" class="summary">
514       <span class="summary-type">&nbsp;</span>
515     </td><td class="summary">
516       <table width="100%" cellpadding="0" cellspacing="0" border="0">
517         <tr>
518           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#getchildren" class="summary-sig-name">getchildren</a>(<span class="summary-sig-arg">self</span>)</span><br />
519       Returns all direct children.  The elements are returned in document
520 order.</td>
521           <td align="right" valign="top">
522             
523             
524           </td>
525         </tr>
526       </table>
527       
528     </td>
529   </tr>
530 <tr>
531     <td width="15%" align="right" valign="top" class="summary">
532       <span class="summary-type">&nbsp;</span>
533     </td><td class="summary">
534       <table width="100%" cellpadding="0" cellspacing="0" border="0">
535         <tr>
536           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#getiterator" class="summary-sig-name">getiterator</a>(<span class="summary-sig-arg">self</span>,
537         <span class="summary-sig-arg">tag</span>=<span class="summary-sig-default">None</span>,
538         <span class="summary-sig-arg">*tags</span>)</span><br />
539       Returns a sequence or iterator of all elements in the subtree in
540 document order (depth first pre-order), starting with this
541 element.</td>
542           <td align="right" valign="top">
543             
544             
545           </td>
546         </tr>
547       </table>
548       
549     </td>
550   </tr>
551 <tr>
552     <td width="15%" align="right" valign="top" class="summary">
553       <span class="summary-type">&nbsp;</span>
554     </td><td class="summary">
555       <table width="100%" cellpadding="0" cellspacing="0" border="0">
556         <tr>
557           <td><span class="summary-sig"><a name="getnext"></a><span class="summary-sig-name">getnext</span>(<span class="summary-sig-arg">self</span>)</span><br />
558       Returns the following sibling of this element or None.</td>
559           <td align="right" valign="top">
560             
561             
562           </td>
563         </tr>
564       </table>
565       
566     </td>
567   </tr>
568 <tr>
569     <td width="15%" align="right" valign="top" class="summary">
570       <span class="summary-type">&nbsp;</span>
571     </td><td class="summary">
572       <table width="100%" cellpadding="0" cellspacing="0" border="0">
573         <tr>
574           <td><span class="summary-sig"><a name="getparent"></a><span class="summary-sig-name">getparent</span>(<span class="summary-sig-arg">self</span>)</span><br />
575       Returns the parent of this element or None for the root element.</td>
576           <td align="right" valign="top">
577             
578             
579           </td>
580         </tr>
581       </table>
582       
583     </td>
584   </tr>
585 <tr>
586     <td width="15%" align="right" valign="top" class="summary">
587       <span class="summary-type">&nbsp;</span>
588     </td><td class="summary">
589       <table width="100%" cellpadding="0" cellspacing="0" border="0">
590         <tr>
591           <td><span class="summary-sig"><a name="getprevious"></a><span class="summary-sig-name">getprevious</span>(<span class="summary-sig-arg">self</span>)</span><br />
592       Returns the preceding sibling of this element or None.</td>
593           <td align="right" valign="top">
594             
595             
596           </td>
597         </tr>
598       </table>
599       
600     </td>
601   </tr>
602 <tr>
603     <td width="15%" align="right" valign="top" class="summary">
604       <span class="summary-type">&nbsp;</span>
605     </td><td class="summary">
606       <table width="100%" cellpadding="0" cellspacing="0" border="0">
607         <tr>
608           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#getroottree" class="summary-sig-name">getroottree</a>(<span class="summary-sig-arg">self</span>)</span><br />
609       Return an ElementTree for the root node of the document that
610 contains this element.</td>
611           <td align="right" valign="top">
612             
613             
614           </td>
615         </tr>
616       </table>
617       
618     </td>
619   </tr>
620 <tr>
621     <td width="15%" align="right" valign="top" class="summary">
622       <span class="summary-type">&nbsp;</span>
623     </td><td class="summary">
624       <table width="100%" cellpadding="0" cellspacing="0" border="0">
625         <tr>
626           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#index" class="summary-sig-name">index</a>(<span class="summary-sig-arg">self</span>,
627         <span class="summary-sig-arg">child</span>,
628         <span class="summary-sig-arg">start</span>=<span class="summary-sig-default">None</span>,
629         <span class="summary-sig-arg">stop</span>=<span class="summary-sig-default">None</span>)</span><br />
630       Find the position of the child within the parent.</td>
631           <td align="right" valign="top">
632             
633             
634           </td>
635         </tr>
636       </table>
637       
638     </td>
639   </tr>
640 <tr>
641     <td width="15%" align="right" valign="top" class="summary">
642       <span class="summary-type">&nbsp;</span>
643     </td><td class="summary">
644       <table width="100%" cellpadding="0" cellspacing="0" border="0">
645         <tr>
646           <td><span class="summary-sig"><a name="insert"></a><span class="summary-sig-name">insert</span>(<span class="summary-sig-arg">self</span>,
647         <span class="summary-sig-arg">index</span>,
648         <span class="summary-sig-arg">element</span>)</span><br />
649       Inserts a subelement at the given position in this element</td>
650           <td align="right" valign="top">
651             
652             
653           </td>
654         </tr>
655       </table>
656       
657     </td>
658   </tr>
659 <tr>
660     <td width="15%" align="right" valign="top" class="summary">
661       <span class="summary-type">&nbsp;</span>
662     </td><td class="summary">
663       <table width="100%" cellpadding="0" cellspacing="0" border="0">
664         <tr>
665           <td><span class="summary-sig"><a name="items"></a><span class="summary-sig-name">items</span>(<span class="summary-sig-arg">self</span>)</span><br />
666       Gets element attributes, as a sequence. The attributes are returned in
667 an arbitrary order.</td>
668           <td align="right" valign="top">
669             
670             
671           </td>
672         </tr>
673       </table>
674       
675     </td>
676   </tr>
677 <tr>
678     <td width="15%" align="right" valign="top" class="summary">
679       <span class="summary-type">&nbsp;</span>
680     </td><td class="summary">
681       <table width="100%" cellpadding="0" cellspacing="0" border="0">
682         <tr>
683           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#iter" class="summary-sig-name">iter</a>(<span class="summary-sig-arg">self</span>,
684         <span class="summary-sig-arg">tag</span>=<span class="summary-sig-default">None</span>,
685         <span class="summary-sig-arg">*tags</span>)</span><br />
686       Iterate over all elements in the subtree in document order (depth
687 first pre-order), starting with this element.</td>
688           <td align="right" valign="top">
689             
690             
691           </td>
692         </tr>
693       </table>
694       
695     </td>
696   </tr>
697 <tr>
698     <td width="15%" align="right" valign="top" class="summary">
699       <span class="summary-type">&nbsp;</span>
700     </td><td class="summary">
701       <table width="100%" cellpadding="0" cellspacing="0" border="0">
702         <tr>
703           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#iterancestors" class="summary-sig-name">iterancestors</a>(<span class="summary-sig-arg">self</span>,
704         <span class="summary-sig-arg">tag</span>=<span class="summary-sig-default">None</span>,
705         <span class="summary-sig-arg">*tags</span>)</span><br />
706       Iterate over the ancestors of this element (from parent to parent).</td>
707           <td align="right" valign="top">
708             
709             
710           </td>
711         </tr>
712       </table>
713       
714     </td>
715   </tr>
716 <tr>
717     <td width="15%" align="right" valign="top" class="summary">
718       <span class="summary-type">&nbsp;</span>
719     </td><td class="summary">
720       <table width="100%" cellpadding="0" cellspacing="0" border="0">
721         <tr>
722           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#iterchildren" class="summary-sig-name">iterchildren</a>(<span class="summary-sig-arg">self</span>,
723         <span class="summary-sig-arg">tag</span>=<span class="summary-sig-default">None</span>,
724         <span class="summary-sig-arg">reversed</span>=<span class="summary-sig-default">False</span>,
725         <span class="summary-sig-arg">*tags</span>)</span><br />
726       Iterate over the children of this element.</td>
727           <td align="right" valign="top">
728             
729             
730           </td>
731         </tr>
732       </table>
733       
734     </td>
735   </tr>
736 <tr>
737     <td width="15%" align="right" valign="top" class="summary">
738       <span class="summary-type">&nbsp;</span>
739     </td><td class="summary">
740       <table width="100%" cellpadding="0" cellspacing="0" border="0">
741         <tr>
742           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#iterdescendants" class="summary-sig-name">iterdescendants</a>(<span class="summary-sig-arg">self</span>,
743         <span class="summary-sig-arg">tag</span>=<span class="summary-sig-default">None</span>,
744         <span class="summary-sig-arg">*tags</span>)</span><br />
745       Iterate over the descendants of this element in document order.</td>
746           <td align="right" valign="top">
747             
748             
749           </td>
750         </tr>
751       </table>
752       
753     </td>
754   </tr>
755 <tr>
756     <td width="15%" align="right" valign="top" class="summary">
757       <span class="summary-type">&nbsp;</span>
758     </td><td class="summary">
759       <table width="100%" cellpadding="0" cellspacing="0" border="0">
760         <tr>
761           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#iterfind" class="summary-sig-name">iterfind</a>(<span class="summary-sig-arg">self</span>,
762         <span class="summary-sig-arg">path</span>,
763         <span class="summary-sig-arg">namespaces</span>=<span class="summary-sig-default">None</span>)</span><br />
764       Iterates over all matching subelements, by tag name or path.</td>
765           <td align="right" valign="top">
766             
767             
768           </td>
769         </tr>
770       </table>
771       
772     </td>
773   </tr>
774 <tr>
775     <td width="15%" align="right" valign="top" class="summary">
776       <span class="summary-type">&nbsp;</span>
777     </td><td class="summary">
778       <table width="100%" cellpadding="0" cellspacing="0" border="0">
779         <tr>
780           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#itersiblings" class="summary-sig-name">itersiblings</a>(<span class="summary-sig-arg">self</span>,
781         <span class="summary-sig-arg">tag</span>=<span class="summary-sig-default">None</span>,
782         <span class="summary-sig-arg">preceding</span>=<span class="summary-sig-default">False</span>,
783         <span class="summary-sig-arg">*tags</span>)</span><br />
784       Iterate over the following or preceding siblings of this element.</td>
785           <td align="right" valign="top">
786             
787             
788           </td>
789         </tr>
790       </table>
791       
792     </td>
793   </tr>
794 <tr>
795     <td width="15%" align="right" valign="top" class="summary">
796       <span class="summary-type">&nbsp;</span>
797     </td><td class="summary">
798       <table width="100%" cellpadding="0" cellspacing="0" border="0">
799         <tr>
800           <td><span class="summary-sig"><a href="lxml.etree._Element-class.html#itertext" class="summary-sig-name">itertext</a>(<span class="summary-sig-arg">self</span>,
801         <span class="summary-sig-arg">tag</span>=<span class="summary-sig-default">None</span>,
802         <span class="summary-sig-arg">with_tail</span>=<span class="summary-sig-default">True</span>,
803         <span class="summary-sig-arg">*tags</span>)</span><br />
804       Iterates over the text content of a subtree.</td>
805           <td align="right" valign="top">
806             
807             
808           </td>
809         </tr>
810       </table>
811       
812     </td>
813   </tr>
814 <tr>
815     <td width="15%" align="right" valign="top" class="summary">
816       <span class="summary-type">&nbsp;</span>
817     </td><td class="summary">
818       <table width="100%" cellpadding="0" cellspacing="0" border="0">
819         <tr>
820           <td><span class="summary-sig"><a name="keys"></a><span class="summary-sig-name">keys</span>(<span class="summary-sig-arg">self</span>)</span><br />
821       Gets a list of attribute names.  The names are returned in an
822 arbitrary order (just like for an ordinary Python dictionary).</td>
823           <td align="right" valign="top">
824             
825             
826           </td>
827         </tr>
828       </table>
829       
830     </td>
831   </tr>
832 <tr>
833     <td width="15%" align="right" valign="top" class="summary">
834       <span class="summary-type">&nbsp;</span>
835     </td><td class="summary">
836       <table width="100%" cellpadding="0" cellspacing="0" border="0">
837         <tr>
838           <td><span class="summary-sig"><a name="makeelement"></a><span class="summary-sig-name">makeelement</span>(<span class="summary-sig-arg">self</span>,
839         <span class="summary-sig-arg">_tag</span>,
840         <span class="summary-sig-arg">attrib</span>=<span class="summary-sig-default">None</span>,
841         <span class="summary-sig-arg">nsmap</span>=<span class="summary-sig-default">None</span>,
842         <span class="summary-sig-arg">**_extra</span>)</span><br />
843       Creates a new element associated with the same document.</td>
844           <td align="right" valign="top">
845             
846             
847           </td>
848         </tr>
849       </table>
850       
851     </td>
852   </tr>
853 <tr>
854     <td width="15%" align="right" valign="top" class="summary">
855       <span class="summary-type">&nbsp;</span>
856     </td><td class="summary">
857       <table width="100%" cellpadding="0" cellspacing="0" border="0">
858         <tr>
859           <td><span class="summary-sig"><a name="remove"></a><span class="summary-sig-name">remove</span>(<span class="summary-sig-arg">self</span>,
860         <span class="summary-sig-arg">element</span>)</span><br />
861       Removes a matching subelement. Unlike the find methods, this
862 method compares elements based on identity, not on tag value
863 or contents.</td>
864           <td align="right" valign="top">
865             
866             
867           </td>
868         </tr>
869       </table>
870       
871     </td>
872   </tr>
873 <tr>
874     <td width="15%" align="right" valign="top" class="summary">
875       <span class="summary-type">&nbsp;</span>
876     </td><td class="summary">
877       <table width="100%" cellpadding="0" cellspacing="0" border="0">
878         <tr>
879           <td><span class="summary-sig"><a name="replace"></a><span class="summary-sig-name">replace</span>(<span class="summary-sig-arg">self</span>,
880         <span class="summary-sig-arg">old_element</span>,
881         <span class="summary-sig-arg">new_element</span>)</span><br />
882       Replaces a subelement with the element passed as second argument.</td>
883           <td align="right" valign="top">
884             
885             
886           </td>
887         </tr>
888       </table>
889       
890     </td>
891   </tr>
892 <tr>
893     <td width="15%" align="right" valign="top" class="summary">
894       <span class="summary-type">&nbsp;</span>
895     </td><td class="summary">
896       <table width="100%" cellpadding="0" cellspacing="0" border="0">
897         <tr>
898           <td><span class="summary-sig"><a name="set"></a><span class="summary-sig-name">set</span>(<span class="summary-sig-arg">self</span>,
899         <span class="summary-sig-arg">key</span>,
900         <span class="summary-sig-arg">value</span>)</span><br />
901       Sets an element attribute.</td>
902           <td align="right" valign="top">
903             
904             
905           </td>
906         </tr>
907       </table>
908       
909     </td>
910   </tr>
911 <tr>
912     <td width="15%" align="right" valign="top" class="summary">
913       <span class="summary-type">&nbsp;</span>
914     </td><td class="summary">
915       <table width="100%" cellpadding="0" cellspacing="0" border="0">
916         <tr>
917           <td><span class="summary-sig"><a name="values"></a><span class="summary-sig-name">values</span>(<span class="summary-sig-arg">self</span>)</span><br />
918       Gets element attribute values as a sequence of strings.  The
919 attributes are returned in an arbitrary order.</td>
920           <td align="right" valign="top">
921             
922             
923           </td>
924         </tr>
925       </table>
926       
927     </td>
928   </tr>
929 <tr>
930     <td width="15%" align="right" valign="top" class="summary">
931       <span class="summary-type">&nbsp;</span>
932     </td><td class="summary">
933       <table width="100%" cellpadding="0" cellspacing="0" border="0">
934         <tr>
935           <td><span class="summary-sig"><a name="xpath"></a><span class="summary-sig-name">xpath</span>(<span class="summary-sig-arg">self</span>,
936         <span class="summary-sig-arg">_path</span>,
937         <span class="summary-sig-arg">namespaces</span>=<span class="summary-sig-default">None</span>,
938         <span class="summary-sig-arg">extensions</span>=<span class="summary-sig-default">None</span>,
939         <span class="summary-sig-arg">smart_strings</span>=<span class="summary-sig-default">True</span>,
940         <span class="summary-sig-arg">**_variables</span>)</span><br />
941       Evaluate an xpath expression using the element as context node.</td>
942           <td align="right" valign="top">
943             
944             
945           </td>
946         </tr>
947       </table>
948       
949     </td>
950   </tr>
951   <tr>
952     <td colspan="2" class="summary">
953     <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
954       <code>__delattr__</code>,
955       <code>__format__</code>,
956       <code>__getattribute__</code>,
957       <code>__hash__</code>,
958       <code>__init__</code>,
959       <code>__reduce__</code>,
960       <code>__reduce_ex__</code>,
961       <code>__setattr__</code>,
962       <code>__sizeof__</code>,
963       <code>__str__</code>,
964       <code>__subclasshook__</code>
965       </p>
966     </td>
967   </tr>
968 </table>
969 <!-- ==================== PROPERTIES ==================== -->
970 <a name="section-Properties"></a>
971 <table class="summary" border="1" cellpadding="3"
972        cellspacing="0" width="100%" bgcolor="white">
973 <tr bgcolor="#70b0f0" class="table-header">
974   <td colspan="2" class="table-header">
975     <table border="0" cellpadding="0" cellspacing="0" width="100%">
976       <tr valign="top">
977         <td align="left"><span class="table-header">Properties</span></td>
978         <td align="right" valign="top"
979          ><span class="options">[<a href="#section-Properties"
980          class="privatelink" onclick="toggle_private();"
981          >hide private</a>]</span></td>
982       </tr>
983     </table>
984   </td>
985 </tr>
986 <tr>
987     <td width="15%" align="right" valign="top" class="summary">
988       <span class="summary-type">&nbsp;</span>
989     </td><td class="summary">
990         <a name="attrib"></a><span class="summary-name">attrib</span><br />
991       Element attribute dictionary. Where possible, use get(), set(),
992 keys(), values() and items() to access element attributes.
993     </td>
994   </tr>
995 <tr>
996     <td width="15%" align="right" valign="top" class="summary">
997       <span class="summary-type">&nbsp;</span>
998     </td><td class="summary">
999         <a href="lxml.etree._Element-class.html#base" class="summary-name">base</a><br />
1000       The base URI of the Element (xml:base or HTML base URL).
1001 None if the base URI is unknown.
1002     </td>
1003   </tr>
1004 <tr>
1005     <td width="15%" align="right" valign="top" class="summary">
1006       <span class="summary-type">&nbsp;</span>
1007     </td><td class="summary">
1008         <a href="lxml.etree._Element-class.html#nsmap" class="summary-name">nsmap</a><br />
1009       Namespace prefix-&gt;URI mapping known in the context of this
1010 Element.  This includes all namespace declarations of the
1011 parents.
1012     </td>
1013   </tr>
1014 <tr>
1015     <td width="15%" align="right" valign="top" class="summary">
1016       <span class="summary-type">&nbsp;</span>
1017     </td><td class="summary">
1018         <a name="prefix"></a><span class="summary-name">prefix</span><br />
1019       Namespace prefix or None.
1020     </td>
1021   </tr>
1022 <tr>
1023     <td width="15%" align="right" valign="top" class="summary">
1024       <span class="summary-type">&nbsp;</span>
1025     </td><td class="summary">
1026         <a name="sourceline"></a><span class="summary-name">sourceline</span><br />
1027       Original line number as found by the parser or None if unknown.
1028     </td>
1029   </tr>
1030 <tr>
1031     <td width="15%" align="right" valign="top" class="summary">
1032       <span class="summary-type">&nbsp;</span>
1033     </td><td class="summary">
1034         <a name="tag"></a><span class="summary-name">tag</span><br />
1035       Element tag
1036     </td>
1037   </tr>
1038 <tr>
1039     <td width="15%" align="right" valign="top" class="summary">
1040       <span class="summary-type">&nbsp;</span>
1041     </td><td class="summary">
1042         <a name="tail"></a><span class="summary-name">tail</span><br />
1043       Text after this element's end tag, but before the next sibling
1044 element's start tag. This is either a string or the value None, if
1045 there was no text.
1046     </td>
1047   </tr>
1048 <tr>
1049     <td width="15%" align="right" valign="top" class="summary">
1050       <span class="summary-type">&nbsp;</span>
1051     </td><td class="summary">
1052         <a name="text"></a><span class="summary-name">text</span><br />
1053       Text before the first subelement. This is either a string or
1054 the value None, if there was no text.
1055     </td>
1056   </tr>
1057   <tr>
1058     <td colspan="2" class="summary">
1059     <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
1060       <code>__class__</code>
1061       </p>
1062     </td>
1063   </tr>
1064 </table>
1065 <!-- ==================== METHOD DETAILS ==================== -->
1066 <a name="section-MethodDetails"></a>
1067 <table class="details" border="1" cellpadding="3"
1068        cellspacing="0" width="100%" bgcolor="white">
1069 <tr bgcolor="#70b0f0" class="table-header">
1070   <td colspan="2" class="table-header">
1071     <table border="0" cellpadding="0" cellspacing="0" width="100%">
1072       <tr valign="top">
1073         <td align="left"><span class="table-header">Method Details</span></td>
1074         <td align="right" valign="top"
1075          ><span class="options">[<a href="#section-MethodDetails"
1076          class="privatelink" onclick="toggle_private();"
1077          >hide private</a>]</span></td>
1078       </tr>
1079     </table>
1080   </td>
1081 </tr>
1082 </table>
1083 <a name="__new__"></a>
1084 <div>
1085 <table class="details" border="1" cellpadding="3"
1086        cellspacing="0" width="100%" bgcolor="white">
1087 <tr><td>
1088   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1089   <tr valign="top"><td>
1090   <h3 class="epydoc"><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>,
1091         <span class="sig-arg">S</span>,
1092         <span class="sig-arg">...</span>)</span>
1093   </h3>
1094   </td><td align="right" valign="top"
1095     >&nbsp;
1096     </td>
1097   </tr></table>
1098   
1099   
1100   <dl class="fields">
1101     <dt>Returns: a new object with type S, a subtype of T</dt>
1102     <dt>Overrides:
1103         object.__new__
1104     </dt>
1105   </dl>
1106 </td></tr></table>
1107 </div>
1108 <a name="__repr__"></a>
1109 <div>
1110 <table class="details" border="1" cellpadding="3"
1111        cellspacing="0" width="100%" bgcolor="white">
1112 <tr><td>
1113   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1114   <tr valign="top"><td>
1115   <h3 class="epydoc"><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">self</span>)</span>
1116     <br /><em class="fname">(Representation operator)</em>
1117   </h3>
1118   </td><td align="right" valign="top"
1119     >&nbsp;
1120     </td>
1121   </tr></table>
1122   
1123   repr(x)
1124   <dl class="fields">
1125     <dt>Overrides:
1126         object.__repr__
1127     </dt>
1128   </dl>
1129 </td></tr></table>
1130 </div>
1131 <a name="addnext"></a>
1132 <div>
1133 <table class="details" border="1" cellpadding="3"
1134        cellspacing="0" width="100%" bgcolor="white">
1135 <tr><td>
1136   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1137   <tr valign="top"><td>
1138   <h3 class="epydoc"><span class="sig"><span class="sig-name">addnext</span>(<span class="sig-arg">self</span>,
1139         <span class="sig-arg">element</span>)</span>
1140   </h3>
1141   </td><td align="right" valign="top"
1142     >&nbsp;
1143     </td>
1144   </tr></table>
1145   
1146   <p>Adds the element as a following sibling directly after this
1147 element.</p>
1148 <p>This is normally used to set a processing instruction or comment after
1149 the root node of a document.  Note that tail text is automatically
1150 discarded when adding at the root level.</p>
1151   <dl class="fields">
1152   </dl>
1153 </td></tr></table>
1154 </div>
1155 <a name="addprevious"></a>
1156 <div>
1157 <table class="details" border="1" cellpadding="3"
1158        cellspacing="0" width="100%" bgcolor="white">
1159 <tr><td>
1160   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1161   <tr valign="top"><td>
1162   <h3 class="epydoc"><span class="sig"><span class="sig-name">addprevious</span>(<span class="sig-arg">self</span>,
1163         <span class="sig-arg">element</span>)</span>
1164   </h3>
1165   </td><td align="right" valign="top"
1166     >&nbsp;
1167     </td>
1168   </tr></table>
1169   
1170   <p>Adds the element as a preceding sibling directly before this
1171 element.</p>
1172 <p>This is normally used to set a processing instruction or comment
1173 before the root node of a document.  Note that tail text is
1174 automatically discarded when adding at the root level.</p>
1175   <dl class="fields">
1176   </dl>
1177 </td></tr></table>
1178 </div>
1179 <a name="clear"></a>
1180 <div>
1181 <table class="details" border="1" cellpadding="3"
1182        cellspacing="0" width="100%" bgcolor="white">
1183 <tr><td>
1184   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1185   <tr valign="top"><td>
1186   <h3 class="epydoc"><span class="sig"><span class="sig-name">clear</span>(<span class="sig-arg">self</span>,
1187         <span class="sig-arg">keep_tail</span>=<span class="sig-default">False</span>)</span>
1188   </h3>
1189   </td><td align="right" valign="top"
1190     >&nbsp;
1191     </td>
1192   </tr></table>
1193   
1194   <p>Resets an element.  This function removes all subelements, clears
1195 all attributes and sets the text and tail properties to None.</p>
1196 <p>Pass <tt class="rst-docutils literal">keep_tail=True</tt> to leave the tail text untouched.</p>
1197   <dl class="fields">
1198   </dl>
1199 </td></tr></table>
1200 </div>
1201 <a name="cssselect"></a>
1202 <div>
1203 <table class="details" border="1" cellpadding="3"
1204        cellspacing="0" width="100%" bgcolor="white">
1205 <tr><td>
1206   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1207   <tr valign="top"><td>
1208   <h3 class="epydoc"><span class="sig"><span class="sig-name">cssselect</span>(<span class="sig-arg">...</span>)</span>
1209   </h3>
1210   </td><td align="right" valign="top"
1211     >&nbsp;
1212     </td>
1213   </tr></table>
1214   
1215   <p>Run the CSS expression on this element and its children,
1216 returning a list of the results.</p>
1217 <p>Equivalent to lxml.cssselect.CSSSelect(expr)(self) -- note
1218 that pre-compiling the expression can provide a substantial
1219 speedup.</p>
1220   <dl class="fields">
1221   </dl>
1222 </td></tr></table>
1223 </div>
1224 <a name="find"></a>
1225 <div>
1226 <table class="details" border="1" cellpadding="3"
1227        cellspacing="0" width="100%" bgcolor="white">
1228 <tr><td>
1229   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1230   <tr valign="top"><td>
1231   <h3 class="epydoc"><span class="sig"><span class="sig-name">find</span>(<span class="sig-arg">self</span>,
1232         <span class="sig-arg">path</span>,
1233         <span class="sig-arg">namespaces</span>=<span class="sig-default">None</span>)</span>
1234   </h3>
1235   </td><td align="right" valign="top"
1236     >&nbsp;
1237     </td>
1238   </tr></table>
1239   
1240   <p>Finds the first matching subelement, by tag name or path.</p>
1241 <p>The optional <tt class="rst-docutils literal">namespaces</tt> argument accepts a
1242 prefix-to-namespace mapping that allows the usage of XPath
1243 prefixes in the path expression.</p>
1244   <dl class="fields">
1245   </dl>
1246 </td></tr></table>
1247 </div>
1248 <a name="findall"></a>
1249 <div>
1250 <table class="details" border="1" cellpadding="3"
1251        cellspacing="0" width="100%" bgcolor="white">
1252 <tr><td>
1253   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1254   <tr valign="top"><td>
1255   <h3 class="epydoc"><span class="sig"><span class="sig-name">findall</span>(<span class="sig-arg">self</span>,
1256         <span class="sig-arg">path</span>,
1257         <span class="sig-arg">namespaces</span>=<span class="sig-default">None</span>)</span>
1258   </h3>
1259   </td><td align="right" valign="top"
1260     >&nbsp;
1261     </td>
1262   </tr></table>
1263   
1264   <p>Finds all matching subelements, by tag name or path.</p>
1265 <p>The optional <tt class="rst-docutils literal">namespaces</tt> argument accepts a
1266 prefix-to-namespace mapping that allows the usage of XPath
1267 prefixes in the path expression.</p>
1268   <dl class="fields">
1269   </dl>
1270 </td></tr></table>
1271 </div>
1272 <a name="findtext"></a>
1273 <div>
1274 <table class="details" border="1" cellpadding="3"
1275        cellspacing="0" width="100%" bgcolor="white">
1276 <tr><td>
1277   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1278   <tr valign="top"><td>
1279   <h3 class="epydoc"><span class="sig"><span class="sig-name">findtext</span>(<span class="sig-arg">self</span>,
1280         <span class="sig-arg">path</span>,
1281         <span class="sig-arg">default</span>=<span class="sig-default">None</span>,
1282         <span class="sig-arg">namespaces</span>=<span class="sig-default">None</span>)</span>
1283   </h3>
1284   </td><td align="right" valign="top"
1285     >&nbsp;
1286     </td>
1287   </tr></table>
1288   
1289   <p>Finds text for the first matching subelement, by tag name or path.</p>
1290 <p>The optional <tt class="rst-docutils literal">namespaces</tt> argument accepts a
1291 prefix-to-namespace mapping that allows the usage of XPath
1292 prefixes in the path expression.</p>
1293   <dl class="fields">
1294   </dl>
1295 </td></tr></table>
1296 </div>
1297 <a name="getchildren"></a>
1298 <div>
1299 <table class="details" border="1" cellpadding="3"
1300        cellspacing="0" width="100%" bgcolor="white">
1301 <tr><td>
1302   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1303   <tr valign="top"><td>
1304   <h3 class="epydoc"><span class="sig"><span class="sig-name">getchildren</span>(<span class="sig-arg">self</span>)</span>
1305   </h3>
1306   </td><td align="right" valign="top"
1307     >&nbsp;
1308     </td>
1309   </tr></table>
1310   
1311   Returns all direct children.  The elements are returned in document
1312 order.
1313   <dl class="fields">
1314   </dl>
1315 <div class="fields">      <p><strong>Deprecated:</strong>
1316         Note that this method has been deprecated as of
1317 ElementTree 1.3 and lxml 2.0.  New code should use
1318 <tt class="rst-docutils literal">list(element)</tt> or simply iterate over elements.
1319       </p>
1320 </div></td></tr></table>
1321 </div>
1322 <a name="getiterator"></a>
1323 <div>
1324 <table class="details" border="1" cellpadding="3"
1325        cellspacing="0" width="100%" bgcolor="white">
1326 <tr><td>
1327   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1328   <tr valign="top"><td>
1329   <h3 class="epydoc"><span class="sig"><span class="sig-name">getiterator</span>(<span class="sig-arg">self</span>,
1330         <span class="sig-arg">tag</span>=<span class="sig-default">None</span>,
1331         <span class="sig-arg">*tags</span>)</span>
1332   </h3>
1333   </td><td align="right" valign="top"
1334     >&nbsp;
1335     </td>
1336   </tr></table>
1337   
1338   <p>Returns a sequence or iterator of all elements in the subtree in
1339 document order (depth first pre-order), starting with this
1340 element.</p>
1341 <p>Can be restricted to find only elements with specific tags,
1342 see <a href="lxml.etree._Element-class.html#iter" class="link">iter</a>.</p>
1343   <dl class="fields">
1344   </dl>
1345 <div class="fields">      <p><strong>Deprecated:</strong>
1346         Note that this method is deprecated as of
1347 ElementTree 1.3 and lxml 2.0.  It returns an iterator in
1348 lxml, which diverges from the original ElementTree
1349 behaviour.  If you want an efficient iterator, use the
1350 <tt class="rst-docutils literal">element.iter()</tt> method instead.  You should only use this
1351 method in new code if you require backwards compatibility
1352 with older versions of lxml or ElementTree.
1353       </p>
1354 </div></td></tr></table>
1355 </div>
1356 <a name="getroottree"></a>
1357 <div>
1358 <table class="details" border="1" cellpadding="3"
1359        cellspacing="0" width="100%" bgcolor="white">
1360 <tr><td>
1361   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1362   <tr valign="top"><td>
1363   <h3 class="epydoc"><span class="sig"><span class="sig-name">getroottree</span>(<span class="sig-arg">self</span>)</span>
1364   </h3>
1365   </td><td align="right" valign="top"
1366     >&nbsp;
1367     </td>
1368   </tr></table>
1369   
1370   <p>Return an ElementTree for the root node of the document that
1371 contains this element.</p>
1372 <p>This is the same as following element.getparent() up the tree until it
1373 returns None (for the root element) and then build an ElementTree for
1374 the last parent that was returned.</p>
1375   <dl class="fields">
1376   </dl>
1377 </td></tr></table>
1378 </div>
1379 <a name="index"></a>
1380 <div>
1381 <table class="details" border="1" cellpadding="3"
1382        cellspacing="0" width="100%" bgcolor="white">
1383 <tr><td>
1384   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1385   <tr valign="top"><td>
1386   <h3 class="epydoc"><span class="sig"><span class="sig-name">index</span>(<span class="sig-arg">self</span>,
1387         <span class="sig-arg">child</span>,
1388         <span class="sig-arg">start</span>=<span class="sig-default">None</span>,
1389         <span class="sig-arg">stop</span>=<span class="sig-default">None</span>)</span>
1390   </h3>
1391   </td><td align="right" valign="top"
1392     >&nbsp;
1393     </td>
1394   </tr></table>
1395   
1396   <p>Find the position of the child within the parent.</p>
1397 <p>This method is not part of the original ElementTree API.</p>
1398   <dl class="fields">
1399   </dl>
1400 </td></tr></table>
1401 </div>
1402 <a name="iter"></a>
1403 <div>
1404 <table class="details" border="1" cellpadding="3"
1405        cellspacing="0" width="100%" bgcolor="white">
1406 <tr><td>
1407   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1408   <tr valign="top"><td>
1409   <h3 class="epydoc"><span class="sig"><span class="sig-name">iter</span>(<span class="sig-arg">self</span>,
1410         <span class="sig-arg">tag</span>=<span class="sig-default">None</span>,
1411         <span class="sig-arg">*tags</span>)</span>
1412   </h3>
1413   </td><td align="right" valign="top"
1414     >&nbsp;
1415     </td>
1416   </tr></table>
1417   
1418   <p>Iterate over all elements in the subtree in document order (depth
1419 first pre-order), starting with this element.</p>
1420 <p>Can be restricted to find only elements with specific tags:
1421 pass <tt class="rst-docutils literal">&quot;{ns}localname&quot;</tt> as tag. Either or both of <tt class="rst-docutils literal">ns</tt> and
1422 <tt class="rst-docutils literal">localname</tt> can be <tt class="rst-docutils literal">*</tt> for a wildcard; <tt class="rst-docutils literal">ns</tt> can be empty
1423 for no namespace. <tt class="rst-docutils literal">&quot;localname&quot;</tt> is equivalent to <tt class="rst-docutils literal"><span class="pre">&quot;{}localname&quot;</span></tt>
1424 (i.e. no namespace) but <tt class="rst-docutils literal">&quot;*&quot;</tt> is <tt class="rst-docutils literal"><span class="pre">&quot;{*}*&quot;</span></tt> (any or no namespace),
1425 not <tt class="rst-docutils literal"><span class="pre">&quot;{}*&quot;</span></tt>.</p>
1426 <p>You can also pass the Element, Comment, ProcessingInstruction and
1427 Entity factory functions to look only for the specific element type.</p>
1428 <p>Passing multiple tags (or a sequence of tags) instead of a single tag
1429 will let the iterator return all elements matching any of these tags,
1430 in document order.</p>
1431   <dl class="fields">
1432   </dl>
1433 </td></tr></table>
1434 </div>
1435 <a name="iterancestors"></a>
1436 <div>
1437 <table class="details" border="1" cellpadding="3"
1438        cellspacing="0" width="100%" bgcolor="white">
1439 <tr><td>
1440   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1441   <tr valign="top"><td>
1442   <h3 class="epydoc"><span class="sig"><span class="sig-name">iterancestors</span>(<span class="sig-arg">self</span>,
1443         <span class="sig-arg">tag</span>=<span class="sig-default">None</span>,
1444         <span class="sig-arg">*tags</span>)</span>
1445   </h3>
1446   </td><td align="right" valign="top"
1447     >&nbsp;
1448     </td>
1449   </tr></table>
1450   
1451   <p>Iterate over the ancestors of this element (from parent to parent).</p>
1452 <p>Can be restricted to find only elements with specific tags,
1453 see <a href="lxml.etree._Element-class.html#iter" class="link">iter</a>.</p>
1454   <dl class="fields">
1455   </dl>
1456 </td></tr></table>
1457 </div>
1458 <a name="iterchildren"></a>
1459 <div>
1460 <table class="details" border="1" cellpadding="3"
1461        cellspacing="0" width="100%" bgcolor="white">
1462 <tr><td>
1463   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1464   <tr valign="top"><td>
1465   <h3 class="epydoc"><span class="sig"><span class="sig-name">iterchildren</span>(<span class="sig-arg">self</span>,
1466         <span class="sig-arg">tag</span>=<span class="sig-default">None</span>,
1467         <span class="sig-arg">reversed</span>=<span class="sig-default">False</span>,
1468         <span class="sig-arg">*tags</span>)</span>
1469   </h3>
1470   </td><td align="right" valign="top"
1471     >&nbsp;
1472     </td>
1473   </tr></table>
1474   
1475   <p>Iterate over the children of this element.</p>
1476 <p>As opposed to using normal iteration on this element, the returned
1477 elements can be reversed with the 'reversed' keyword and restricted
1478 to find only elements with specific tags, see <a href="lxml.etree._Element-class.html#iter" class="link">iter</a>.</p>
1479   <dl class="fields">
1480   </dl>
1481 </td></tr></table>
1482 </div>
1483 <a name="iterdescendants"></a>
1484 <div>
1485 <table class="details" border="1" cellpadding="3"
1486        cellspacing="0" width="100%" bgcolor="white">
1487 <tr><td>
1488   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1489   <tr valign="top"><td>
1490   <h3 class="epydoc"><span class="sig"><span class="sig-name">iterdescendants</span>(<span class="sig-arg">self</span>,
1491         <span class="sig-arg">tag</span>=<span class="sig-default">None</span>,
1492         <span class="sig-arg">*tags</span>)</span>
1493   </h3>
1494   </td><td align="right" valign="top"
1495     >&nbsp;
1496     </td>
1497   </tr></table>
1498   
1499   <p>Iterate over the descendants of this element in document order.</p>
1500 <p>As opposed to <tt class="rst-docutils literal">el.iter()</tt>, this iterator does not yield the element
1501 itself.  The returned elements can be restricted to find only elements
1502 with specific tags, see <a href="lxml.etree._Element-class.html#iter" class="link">iter</a>.</p>
1503   <dl class="fields">
1504   </dl>
1505 </td></tr></table>
1506 </div>
1507 <a name="iterfind"></a>
1508 <div>
1509 <table class="details" border="1" cellpadding="3"
1510        cellspacing="0" width="100%" bgcolor="white">
1511 <tr><td>
1512   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1513   <tr valign="top"><td>
1514   <h3 class="epydoc"><span class="sig"><span class="sig-name">iterfind</span>(<span class="sig-arg">self</span>,
1515         <span class="sig-arg">path</span>,
1516         <span class="sig-arg">namespaces</span>=<span class="sig-default">None</span>)</span>
1517   </h3>
1518   </td><td align="right" valign="top"
1519     >&nbsp;
1520     </td>
1521   </tr></table>
1522   
1523   <p>Iterates over all matching subelements, by tag name or path.</p>
1524 <p>The optional <tt class="rst-docutils literal">namespaces</tt> argument accepts a
1525 prefix-to-namespace mapping that allows the usage of XPath
1526 prefixes in the path expression.</p>
1527   <dl class="fields">
1528   </dl>
1529 </td></tr></table>
1530 </div>
1531 <a name="itersiblings"></a>
1532 <div>
1533 <table class="details" border="1" cellpadding="3"
1534        cellspacing="0" width="100%" bgcolor="white">
1535 <tr><td>
1536   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1537   <tr valign="top"><td>
1538   <h3 class="epydoc"><span class="sig"><span class="sig-name">itersiblings</span>(<span class="sig-arg">self</span>,
1539         <span class="sig-arg">tag</span>=<span class="sig-default">None</span>,
1540         <span class="sig-arg">preceding</span>=<span class="sig-default">False</span>,
1541         <span class="sig-arg">*tags</span>)</span>
1542   </h3>
1543   </td><td align="right" valign="top"
1544     >&nbsp;
1545     </td>
1546   </tr></table>
1547   
1548   <p>Iterate over the following or preceding siblings of this element.</p>
1549 <p>The direction is determined by the 'preceding' keyword which
1550 defaults to False, i.e. forward iteration over the following
1551 siblings.  When True, the iterator yields the preceding
1552 siblings in reverse document order, i.e. starting right before
1553 the current element and going backwards.</p>
1554 <p>Can be restricted to find only elements with specific tags,
1555 see <a href="lxml.etree._Element-class.html#iter" class="link">iter</a>.</p>
1556   <dl class="fields">
1557   </dl>
1558 </td></tr></table>
1559 </div>
1560 <a name="itertext"></a>
1561 <div>
1562 <table class="details" border="1" cellpadding="3"
1563        cellspacing="0" width="100%" bgcolor="white">
1564 <tr><td>
1565   <table width="100%" cellpadding="0" cellspacing="0" border="0">
1566   <tr valign="top"><td>
1567   <h3 class="epydoc"><span class="sig"><span class="sig-name">itertext</span>(<span class="sig-arg">self</span>,
1568         <span class="sig-arg">tag</span>=<span class="sig-default">None</span>,
1569         <span class="sig-arg">with_tail</span>=<span class="sig-default">True</span>,
1570         <span class="sig-arg">*tags</span>)</span>
1571   </h3>
1572   </td><td align="right" valign="top"
1573     >&nbsp;
1574     </td>
1575   </tr></table>
1576   
1577   <p>Iterates over the text content of a subtree.</p>
1578 <p>You can pass tag names to restrict text content to specific elements,
1579 see <a href="lxml.etree._Element-class.html#iter" class="link">iter</a>.</p>
1580 <p>You can set the <tt class="rst-docutils literal">with_tail</tt> keyword argument to <tt class="rst-docutils literal">False</tt> to skip
1581 over tail text.</p>
1582   <dl class="fields">
1583   </dl>
1584 </td></tr></table>
1585 </div>
1586 <br />
1587 <!-- ==================== PROPERTY DETAILS ==================== -->
1588 <a name="section-PropertyDetails"></a>
1589 <table class="details" border="1" cellpadding="3"
1590        cellspacing="0" width="100%" bgcolor="white">
1591 <tr bgcolor="#70b0f0" class="table-header">
1592   <td colspan="2" class="table-header">
1593     <table border="0" cellpadding="0" cellspacing="0" width="100%">
1594       <tr valign="top">
1595         <td align="left"><span class="table-header">Property Details</span></td>
1596         <td align="right" valign="top"
1597          ><span class="options">[<a href="#section-PropertyDetails"
1598          class="privatelink" onclick="toggle_private();"
1599          >hide private</a>]</span></td>
1600       </tr>
1601     </table>
1602   </td>
1603 </tr>
1604 </table>
1605 <a name="base"></a>
1606 <div>
1607 <table class="details" border="1" cellpadding="3"
1608        cellspacing="0" width="100%" bgcolor="white">
1609 <tr><td>
1610   <h3 class="epydoc">base</h3>
1611   <p>The base URI of the Element (xml:base or HTML base URL).
1612 None if the base URI is unknown.</p>
1613 <p>Note that the value depends on the URL of the document that
1614 holds the Element if there is no xml:base attribute on the
1615 Element or its ancestors.</p>
1616 <p>Setting this property will set an xml:base attribute on the
1617 Element, regardless of the document type (XML or HTML).</p>
1618   <dl class="fields">
1619   </dl>
1620 </td></tr></table>
1621 </div>
1622 <a name="nsmap"></a>
1623 <div>
1624 <table class="details" border="1" cellpadding="3"
1625        cellspacing="0" width="100%" bgcolor="white">
1626 <tr><td>
1627   <h3 class="epydoc">nsmap</h3>
1628   <p>Namespace prefix-&gt;URI mapping known in the context of this
1629 Element.  This includes all namespace declarations of the
1630 parents.</p>
1631 <p>Note that changing the returned dict has no effect on the Element.</p>
1632   <dl class="fields">
1633   </dl>
1634 </td></tr></table>
1635 </div>
1636 <br />
1637 <!-- ==================== NAVIGATION BAR ==================== -->
1638 <table class="navbar" border="0" width="100%" cellpadding="0"
1639        bgcolor="#a0c0ff" cellspacing="0">
1640   <tr valign="middle">
1641   <!-- Home link -->
1642       <th>&nbsp;&nbsp;&nbsp;<a
1643         href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
1644
1645   <!-- Tree link -->
1646       <th>&nbsp;&nbsp;&nbsp;<a
1647         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
1648
1649   <!-- Index link -->
1650       <th>&nbsp;&nbsp;&nbsp;<a
1651         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
1652
1653   <!-- Help link -->
1654       <th>&nbsp;&nbsp;&nbsp;<a
1655         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
1656
1657   <!-- Project homepage -->
1658       <th class="navbar" align="right" width="100%">
1659         <table border="0" cellpadding="0" cellspacing="0">
1660           <tr><th class="navbar" align="center"
1661             ><a class="navbar" target="_top" href="/">lxml API</a></th>
1662           </tr></table></th>
1663   </tr>
1664 </table>
1665 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
1666   <tr>
1667     <td align="left" class="footer">
1668     Generated by Epydoc 3.0.1
1669     on Wed Jan 29 12:26:21 2020
1670     </td>
1671     <td align="right" class="footer">
1672       <a target="mainFrame" href="http://epydoc.sourceforge.net"
1673         >http://epydoc.sourceforge.net</a>
1674     </td>
1675   </tr>
1676 </table>
1677
1678 <script type="text/javascript">
1679   <!--
1680   // Private objects are initially displayed (because if
1681   // javascript is turned off then we want them to be
1682   // visible); but by default, we want to hide them.  So hide
1683   // them unless we have a cookie that says to show them.
1684   checkCookie();
1685   // -->
1686 </script>
1687 </body>
1688 </html>