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">
6 <title>lxml.html</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
11 <body bgcolor="white" text="black" link="blue" vlink="#204080"
13 <!-- ==================== NAVIGATION BAR ==================== -->
14 <table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
18 <th> <a
19 href="lxml-module.html">Home</a> </th>
22 <th> <a
23 href="module-tree.html">Trees</a> </th>
26 <th> <a
27 href="identifier-index.html">Indices</a> </th>
30 <th> <a
31 href="help.html">Help</a> </th>
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>
41 <table width="100%" cellpadding="0" cellspacing="0">
44 <span class="breadcrumbs">
45 <a href="lxml-module.html">Package lxml</a> ::
50 <table cellpadding="0" cellspacing="0">
51 <!-- hide/show private -->
52 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
53 onclick="toggle_private();">hide private</a>]</span></td></tr>
54 <tr><td align="right"><span class="options"
55 >[<a href="frames.html" target="_top">frames</a
56 >] | <a href="lxml.html-module.html"
57 target="_top">no frames</a>]</span></td></tr>
62 <!-- ==================== PACKAGE DESCRIPTION ==================== -->
63 <h1 class="epydoc">Package html</h1><p class="nomargin-top"><span class="codelink"><a href="lxml.html-pysrc.html">source code</a></span></p>
64 The <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal">lxml.html</tt> tool set for HTML handling.
66 <!-- ==================== SUBMODULES ==================== -->
67 <a name="section-Submodules"></a>
68 <table class="summary" border="1" cellpadding="3"
69 cellspacing="0" width="100%" bgcolor="white">
70 <tr bgcolor="#70b0f0" class="table-header">
71 <td colspan="2" class="table-header">
72 <table border="0" cellpadding="0" cellspacing="0" width="100%">
74 <td align="left"><span class="table-header">Submodules</span></td>
75 <td align="right" valign="top"
76 ><span class="options">[<a href="#section-Submodules"
77 class="privatelink" onclick="toggle_private();"
78 >hide private</a>]</span></td>
83 <tr><td class="summary">
85 <li> <strong class="uidlink"><a href="lxml.html.ElementSoup-module.html">lxml.html.ElementSoup</a></strong>: <em class="summary">Legacy interface to the BeautifulSoup HTML parser.</em> </li>
86 <li class="private"> <strong class="uidlink">lxml.html._dictmixin</strong> </li>
87 <li class="private"> <strong class="uidlink">lxml.html._setmixin</strong> </li>
88 <li> <strong class="uidlink"><a href="lxml.html.builder-module.html">lxml.html.builder</a></strong>: <em class="summary">A set of HTML generator tags for building HTML documents.</em> </li>
89 <li> <strong class="uidlink"><a href="lxml.html.clean-module.html">lxml.html.clean</a></strong>: <em class="summary">A cleanup tool for HTML.</em> </li>
90 <li> <strong class="uidlink"><a href="lxml.html.defs-module.html">lxml.html.defs</a></strong> </li>
91 <li> <strong class="uidlink"><a href="lxml.html.diff-module.html">lxml.html.diff</a></strong> </li>
92 <li> <strong class="uidlink"><a href="lxml.html.formfill-module.html">lxml.html.formfill</a></strong> </li>
93 <li> <strong class="uidlink"><a href="lxml.html.html5parser-module.html">lxml.html.html5parser</a></strong>: <em class="summary">An interface to html5lib that mimics the lxml.html interface.</em> </li>
94 <li> <strong class="uidlink"><a href="lxml.html.soupparser-module.html">lxml.html.soupparser</a></strong>: <em class="summary">External interface to the BeautifulSoup HTML parser.</em> </li>
95 <li> <strong class="uidlink"><a href="lxml.html.usedoctest-module.html">lxml.html.usedoctest</a></strong>: <em class="summary">Doctest module for HTML comparison.</em> </li>
100 <!-- ==================== CLASSES ==================== -->
101 <a name="section-Classes"></a>
102 <table class="summary" border="1" cellpadding="3"
103 cellspacing="0" width="100%" bgcolor="white">
104 <tr bgcolor="#70b0f0" class="table-header">
105 <td colspan="2" class="table-header">
106 <table border="0" cellpadding="0" cellspacing="0" width="100%">
108 <td align="left"><span class="table-header">Classes</span></td>
109 <td align="right" valign="top"
110 ><span class="options">[<a href="#section-Classes"
111 class="privatelink" onclick="toggle_private();"
112 >hide private</a>]</span></td>
118 <td width="15%" align="right" valign="top" class="summary">
119 <span class="summary-type"> </span>
120 </td><td class="summary">
121 <a href="lxml.html.HtmlMixin-class.html" class="summary-name" onclick="show_private();">HtmlMixin</a>
125 <td width="15%" align="right" valign="top" class="summary">
126 <span class="summary-type"> </span>
127 </td><td class="summary">
128 <a href="lxml.html._MethodFunc-class.html" class="summary-name" onclick="show_private();">_MethodFunc</a><br />
129 An object that represents a method on an element as a function;
130 the function takes either an element or an HTML string. It
131 returns whatever the function normally returns, or if the function
132 works in-place (and so returns None) it returns a serialized form
133 of the resulting document.
137 <td width="15%" align="right" valign="top" class="summary">
138 <span class="summary-type"> </span>
139 </td><td class="summary">
140 <a href="lxml.html.HtmlComment-class.html" class="summary-name" onclick="show_private();">HtmlComment</a>
144 <td width="15%" align="right" valign="top" class="summary">
145 <span class="summary-type"> </span>
146 </td><td class="summary">
147 <a href="lxml.html.HtmlElement-class.html" class="summary-name" onclick="show_private();">HtmlElement</a>
151 <td width="15%" align="right" valign="top" class="summary">
152 <span class="summary-type"> </span>
153 </td><td class="summary">
154 <a href="lxml.html.HtmlProcessingInstruction-class.html" class="summary-name" onclick="show_private();">HtmlProcessingInstruction</a>
158 <td width="15%" align="right" valign="top" class="summary">
159 <span class="summary-type"> </span>
160 </td><td class="summary">
161 <a href="lxml.html.HtmlEntity-class.html" class="summary-name" onclick="show_private();">HtmlEntity</a>
165 <td width="15%" align="right" valign="top" class="summary">
166 <span class="summary-type"> </span>
167 </td><td class="summary">
168 <a href="lxml.html.HtmlElementClassLookup-class.html" class="summary-name" onclick="show_private();">HtmlElementClassLookup</a><br />
169 A lookup scheme for HTML Element classes.
173 <td width="15%" align="right" valign="top" class="summary">
174 <span class="summary-type"> </span>
175 </td><td class="summary">
176 <a href="lxml.html.FormElement-class.html" class="summary-name" onclick="show_private();">FormElement</a><br />
177 Represents a <form> element.
181 <td width="15%" align="right" valign="top" class="summary">
182 <span class="summary-type"> </span>
183 </td><td class="summary">
184 <a href="lxml.html.FieldsDict-class.html" class="summary-name" onclick="show_private();">FieldsDict</a>
188 <td width="15%" align="right" valign="top" class="summary">
189 <span class="summary-type"> </span>
190 </td><td class="summary">
191 <a href="lxml.html.InputGetter-class.html" class="summary-name" onclick="show_private();">InputGetter</a><br />
192 An accessor that represents all the input fields in a form.
196 <td width="15%" align="right" valign="top" class="summary">
197 <span class="summary-type"> </span>
198 </td><td class="summary">
199 <a href="lxml.html.InputMixin-class.html" class="summary-name" onclick="show_private();">InputMixin</a><br />
200 Mix-in for all input elements (input, select, and textarea)
204 <td width="15%" align="right" valign="top" class="summary">
205 <span class="summary-type"> </span>
206 </td><td class="summary">
207 <a href="lxml.html.TextareaElement-class.html" class="summary-name" onclick="show_private();">TextareaElement</a><br />
208 <tt class="rst-rst-rst-rst-docutils literal rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal"><textarea></tt> element. You can get the name with <tt class="rst-rst-rst-rst-docutils literal rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal">.name</tt> and
209 get/set the value with <tt class="rst-rst-rst-rst-docutils literal rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal">.value</tt>
213 <td width="15%" align="right" valign="top" class="summary">
214 <span class="summary-type"> </span>
215 </td><td class="summary">
216 <a href="lxml.html.SelectElement-class.html" class="summary-name" onclick="show_private();">SelectElement</a><br />
217 <tt class="rst-rst-rst-rst-docutils literal rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal"><select></tt> element. You can get the name with <tt class="rst-rst-rst-rst-docutils literal rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal">.name</tt>.
221 <td width="15%" align="right" valign="top" class="summary">
222 <span class="summary-type"> </span>
223 </td><td class="summary">
224 <a href="lxml.html.MultipleSelectOptions-class.html" class="summary-name" onclick="show_private();">MultipleSelectOptions</a><br />
225 Represents all the selected options in a <tt class="rst-rst-docutils literal rst-docutils literal"><select multiple></tt> element.
229 <td width="15%" align="right" valign="top" class="summary">
230 <span class="summary-type"> </span>
231 </td><td class="summary">
232 <a href="lxml.html.RadioGroup-class.html" class="summary-name" onclick="show_private();">RadioGroup</a><br />
233 This object represents several <tt class="rst-rst-docutils literal rst-docutils literal"><input type=radio></tt> elements
234 that have the same name.
238 <td width="15%" align="right" valign="top" class="summary">
239 <span class="summary-type"> </span>
240 </td><td class="summary">
241 <a href="lxml.html.CheckboxGroup-class.html" class="summary-name" onclick="show_private();">CheckboxGroup</a><br />
242 Represents a group of checkboxes (<tt class="rst-rst-docutils literal rst-docutils literal"><input type=checkbox></tt>) that
247 <td width="15%" align="right" valign="top" class="summary">
248 <span class="summary-type"> </span>
249 </td><td class="summary">
250 <a href="lxml.html.CheckboxValues-class.html" class="summary-name" onclick="show_private();">CheckboxValues</a><br />
251 Represents the values of the checked checkboxes in a group of
252 checkboxes with the same name.
256 <td width="15%" align="right" valign="top" class="summary">
257 <span class="summary-type"> </span>
258 </td><td class="summary">
259 <a href="lxml.html.InputElement-class.html" class="summary-name" onclick="show_private();">InputElement</a><br />
260 Represents an <tt class="rst-rst-rst-rst-docutils literal rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal"><input></tt> element.
264 <td width="15%" align="right" valign="top" class="summary">
265 <span class="summary-type"> </span>
266 </td><td class="summary">
267 <a href="lxml.html.LabelElement-class.html" class="summary-name" onclick="show_private();">LabelElement</a><br />
268 Represents a <tt class="rst-rst-rst-docutils literal rst-rst-docutils literal rst-docutils literal"><label></tt> element.
272 <td width="15%" align="right" valign="top" class="summary">
273 <span class="summary-type"> </span>
274 </td><td class="summary">
275 <a href="lxml.html.HTMLParser-class.html" class="summary-name" onclick="show_private();">HTMLParser</a><br />
276 An HTML parser that is configured to return lxml.html Element
281 <td width="15%" align="right" valign="top" class="summary">
282 <span class="summary-type"> </span>
283 </td><td class="summary">
284 <a href="lxml.html.XHTMLParser-class.html" class="summary-name" onclick="show_private();">XHTMLParser</a><br />
285 An XML parser that is configured to return lxml.html Element
290 <!-- ==================== FUNCTIONS ==================== -->
291 <a name="section-Functions"></a>
292 <table class="summary" border="1" cellpadding="3"
293 cellspacing="0" width="100%" bgcolor="white">
294 <tr bgcolor="#70b0f0" class="table-header">
295 <td colspan="2" class="table-header">
296 <table border="0" cellpadding="0" cellspacing="0" width="100%">
298 <td align="left"><span class="table-header">Functions</span></td>
299 <td align="right" valign="top"
300 ><span class="options">[<a href="#section-Functions"
301 class="privatelink" onclick="toggle_private();"
302 >hide private</a>]</span></td>
308 <td width="15%" align="right" valign="top" class="summary">
309 <span class="summary-type"> </span>
310 </td><td class="summary">
311 <table width="100%" cellpadding="0" cellspacing="0" border="0">
313 <td><span class="summary-sig"><a name="__fix_docstring"></a><span class="summary-sig-name">__fix_docstring</span>(<span class="summary-sig-arg">s</span>)</span></td>
314 <td align="right" valign="top">
315 <span class="codelink"><a href="lxml.html-pysrc.html#__fix_docstring">source code</a></span>
324 <td width="15%" align="right" valign="top" class="summary">
325 <span class="summary-type"> </span>
326 </td><td class="summary">
327 <table width="100%" cellpadding="0" cellspacing="0" border="0">
329 <td><span class="summary-sig"><a name="_unquote_match"></a><span class="summary-sig-name">_unquote_match</span>(<span class="summary-sig-arg">s</span>,
330 <span class="summary-sig-arg">pos</span>)</span></td>
331 <td align="right" valign="top">
332 <span class="codelink"><a href="lxml.html-pysrc.html#_unquote_match">source code</a></span>
341 <td width="15%" align="right" valign="top" class="summary">
342 <span class="summary-type"> </span>
343 </td><td class="summary">
344 <table width="100%" cellpadding="0" cellspacing="0" border="0">
346 <td><span class="summary-sig"><a name="_transform_result"></a><span class="summary-sig-name">_transform_result</span>(<span class="summary-sig-arg">typ</span>,
347 <span class="summary-sig-arg">result</span>)</span><br />
348 Convert the result back into the input type.</td>
349 <td align="right" valign="top">
350 <span class="codelink"><a href="lxml.html-pysrc.html#_transform_result">source code</a></span>
359 <td width="15%" align="right" valign="top" class="summary">
360 <span class="summary-type"> </span>
361 </td><td class="summary">
362 <table width="100%" cellpadding="0" cellspacing="0" border="0">
364 <td><span class="summary-sig"><a name="_nons"></a><span class="summary-sig-name">_nons</span>(<span class="summary-sig-arg">tag</span>)</span></td>
365 <td align="right" valign="top">
366 <span class="codelink"><a href="lxml.html-pysrc.html#_nons">source code</a></span>
375 <td width="15%" align="right" valign="top" class="summary">
376 <span class="summary-type"> </span>
377 </td><td class="summary">
378 <table width="100%" cellpadding="0" cellspacing="0" border="0">
380 <td><span class="summary-sig"><a name="document_fromstring"></a><span class="summary-sig-name">document_fromstring</span>(<span class="summary-sig-arg">html</span>,
381 <span class="summary-sig-arg">parser</span>=<span class="summary-sig-default">None</span>,
382 <span class="summary-sig-arg">**kw</span>)</span></td>
383 <td align="right" valign="top">
384 <span class="codelink"><a href="lxml.html-pysrc.html#document_fromstring">source code</a></span>
393 <td width="15%" align="right" valign="top" class="summary">
394 <span class="summary-type"> </span>
395 </td><td class="summary">
396 <table width="100%" cellpadding="0" cellspacing="0" border="0">
398 <td><span class="summary-sig"><a href="lxml.html-module.html#fragments_fromstring" class="summary-sig-name">fragments_fromstring</a>(<span class="summary-sig-arg">html</span>,
399 <span class="summary-sig-arg">no_leading_text</span>=<span class="summary-sig-default">False</span>,
400 <span class="summary-sig-arg">base_url</span>=<span class="summary-sig-default">None</span>,
401 <span class="summary-sig-arg">parser</span>=<span class="summary-sig-default">None</span>,
402 <span class="summary-sig-arg">**kw</span>)</span><br />
403 Parses several HTML elements, returning a list of elements.</td>
404 <td align="right" valign="top">
405 <span class="codelink"><a href="lxml.html-pysrc.html#fragments_fromstring">source code</a></span>
414 <td width="15%" align="right" valign="top" class="summary">
415 <span class="summary-type"> </span>
416 </td><td class="summary">
417 <table width="100%" cellpadding="0" cellspacing="0" border="0">
419 <td><span class="summary-sig"><a href="lxml.html-module.html#fragment_fromstring" class="summary-sig-name">fragment_fromstring</a>(<span class="summary-sig-arg">html</span>,
420 <span class="summary-sig-arg">create_parent</span>=<span class="summary-sig-default">False</span>,
421 <span class="summary-sig-arg">base_url</span>=<span class="summary-sig-default">None</span>,
422 <span class="summary-sig-arg">parser</span>=<span class="summary-sig-default">None</span>,
423 <span class="summary-sig-arg">**kw</span>)</span><br />
424 Parses a single HTML element; it is an error if there is more than
425 one element, or if anything but whitespace precedes or follows the
427 <td align="right" valign="top">
428 <span class="codelink"><a href="lxml.html-pysrc.html#fragment_fromstring">source code</a></span>
437 <td width="15%" align="right" valign="top" class="summary">
438 <span class="summary-type"> </span>
439 </td><td class="summary">
440 <table width="100%" cellpadding="0" cellspacing="0" border="0">
442 <td><span class="summary-sig"><a href="lxml.html-module.html#fromstring" class="summary-sig-name">fromstring</a>(<span class="summary-sig-arg">html</span>,
443 <span class="summary-sig-arg">base_url</span>=<span class="summary-sig-default">None</span>,
444 <span class="summary-sig-arg">parser</span>=<span class="summary-sig-default">None</span>,
445 <span class="summary-sig-arg">**kw</span>)</span><br />
446 Parse the html, returning a single element/document.</td>
447 <td align="right" valign="top">
448 <span class="codelink"><a href="lxml.html-pysrc.html#fromstring">source code</a></span>
457 <td width="15%" align="right" valign="top" class="summary">
458 <span class="summary-type"> </span>
459 </td><td class="summary">
460 <table width="100%" cellpadding="0" cellspacing="0" border="0">
462 <td><span class="summary-sig"><a href="lxml.html-module.html#parse" class="summary-sig-name">parse</a>(<span class="summary-sig-arg">filename_or_url</span>,
463 <span class="summary-sig-arg">parser</span>=<span class="summary-sig-default">None</span>,
464 <span class="summary-sig-arg">base_url</span>=<span class="summary-sig-default">None</span>,
465 <span class="summary-sig-arg">**kw</span>)</span><br />
466 Parse a filename, URL, or file-like object into an HTML document
467 tree. Note: this returns a tree, not an element. Use
468 <tt class="rst-docutils literal"><span class="pre">parse(...).getroot()</span></tt> to get the document root.</td>
469 <td align="right" valign="top">
470 <span class="codelink"><a href="lxml.html-pysrc.html#parse">source code</a></span>
479 <td width="15%" align="right" valign="top" class="summary">
480 <span class="summary-type"> </span>
481 </td><td class="summary">
482 <table width="100%" cellpadding="0" cellspacing="0" border="0">
484 <td><span class="summary-sig"><a name="_contains_block_level_tag"></a><span class="summary-sig-name">_contains_block_level_tag</span>(<span class="summary-sig-arg">el</span>)</span></td>
485 <td align="right" valign="top">
486 <span class="codelink"><a href="lxml.html-pysrc.html#_contains_block_level_tag">source code</a></span>
495 <td width="15%" align="right" valign="top" class="summary">
496 <span class="summary-type"> </span>
497 </td><td class="summary">
498 <table width="100%" cellpadding="0" cellspacing="0" border="0">
500 <td><span class="summary-sig"><a name="_element_name"></a><span class="summary-sig-name">_element_name</span>(<span class="summary-sig-arg">el</span>)</span></td>
501 <td align="right" valign="top">
502 <span class="codelink"><a href="lxml.html-pysrc.html#_element_name">source code</a></span>
511 <td width="15%" align="right" valign="top" class="summary">
512 <span class="summary-type"> </span>
513 </td><td class="summary">
514 <table width="100%" cellpadding="0" cellspacing="0" border="0">
516 <td><span class="summary-sig"><a href="lxml.html-module.html#submit_form" class="summary-sig-name">submit_form</a>(<span class="summary-sig-arg">form</span>,
517 <span class="summary-sig-arg">extra_values</span>=<span class="summary-sig-default">None</span>,
518 <span class="summary-sig-arg">open_http</span>=<span class="summary-sig-default">None</span>)</span><br />
519 Helper function to submit a form. Returns a file-like object, as from
520 <tt class="rst-docutils literal">urllib.urlopen()</tt>. This object also has a <tt class="rst-docutils literal">.geturl()</tt> function,
521 which shows the URL if there were any redirects.</td>
522 <td align="right" valign="top">
523 <span class="codelink"><a href="lxml.html-pysrc.html#submit_form">source code</a></span>
532 <td width="15%" align="right" valign="top" class="summary">
533 <span class="summary-type"> </span>
534 </td><td class="summary">
535 <table width="100%" cellpadding="0" cellspacing="0" border="0">
537 <td><span class="summary-sig"><a name="open_http_urllib"></a><span class="summary-sig-name">open_http_urllib</span>(<span class="summary-sig-arg">method</span>,
538 <span class="summary-sig-arg">url</span>,
539 <span class="summary-sig-arg">values</span>)</span></td>
540 <td align="right" valign="top">
541 <span class="codelink"><a href="lxml.html-pysrc.html#open_http_urllib">source code</a></span>
550 <td width="15%" align="right" valign="top" class="summary">
551 <span class="summary-type"> </span>
552 </td><td class="summary">
553 <table width="100%" cellpadding="0" cellspacing="0" border="0">
555 <td><span class="summary-sig"><a name="html_to_xhtml"></a><span class="summary-sig-name">html_to_xhtml</span>(<span class="summary-sig-arg">html</span>)</span><br />
556 Convert all tags in an HTML tree to XHTML by moving them to the
557 XHTML namespace.</td>
558 <td align="right" valign="top">
559 <span class="codelink"><a href="lxml.html-pysrc.html#html_to_xhtml">source code</a></span>
568 <td width="15%" align="right" valign="top" class="summary">
569 <span class="summary-type"> </span>
570 </td><td class="summary">
571 <table width="100%" cellpadding="0" cellspacing="0" border="0">
573 <td><span class="summary-sig"><a name="xhtml_to_html"></a><span class="summary-sig-name">xhtml_to_html</span>(<span class="summary-sig-arg">xhtml</span>)</span><br />
574 Convert all tags in an XHTML tree to HTML by removing their
575 XHTML namespace.</td>
576 <td align="right" valign="top">
577 <span class="codelink"><a href="lxml.html-pysrc.html#xhtml_to_html">source code</a></span>
586 <td width="15%" align="right" valign="top" class="summary">
587 <span class="summary-type"> </span>
588 </td><td class="summary">
589 <table width="100%" cellpadding="0" cellspacing="0" border="0">
591 <td><span class="summary-sig"><a name="__str_replace_meta_content_type"></a><span class="summary-sig-name">__str_replace_meta_content_type</span>(<span class="summary-sig-arg">...</span>)</span><br />
592 sub(repl, string[, count = 0]) --> newstring
593 Return the string obtained by replacing the leftmost non-overlapping
594 occurrences of pattern in string by the replacement repl.</td>
595 <td align="right" valign="top">
596 <span class="codelink"><a href="lxml.html-pysrc.html#__str_replace_meta_content_type">source code</a></span>
605 <td width="15%" align="right" valign="top" class="summary">
606 <span class="summary-type"> </span>
607 </td><td class="summary">
608 <table width="100%" cellpadding="0" cellspacing="0" border="0">
610 <td><span class="summary-sig"><a name="__bytes_replace_meta_content_type"></a><span class="summary-sig-name">__bytes_replace_meta_content_type</span>(<span class="summary-sig-arg">...</span>)</span><br />
611 sub(repl, string[, count = 0]) --> newstring
612 Return the string obtained by replacing the leftmost non-overlapping
613 occurrences of pattern in string by the replacement repl.</td>
614 <td align="right" valign="top">
615 <span class="codelink"><a href="lxml.html-pysrc.html#__bytes_replace_meta_content_type">source code</a></span>
624 <td width="15%" align="right" valign="top" class="summary">
625 <span class="summary-type"> </span>
626 </td><td class="summary">
627 <table width="100%" cellpadding="0" cellspacing="0" border="0">
629 <td><span class="summary-sig"><a href="lxml.html-module.html#tostring" class="summary-sig-name">tostring</a>(<span class="summary-sig-arg">doc</span>,
630 <span class="summary-sig-arg">pretty_print</span>=<span class="summary-sig-default">False</span>,
631 <span class="summary-sig-arg">include_meta_content_type</span>=<span class="summary-sig-default">False</span>,
632 <span class="summary-sig-arg">encoding</span>=<span class="summary-sig-default">None</span>,
633 <span class="summary-sig-arg">method</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">html</code><code class="variable-quote">'</code></span>,
634 <span class="summary-sig-arg">with_tail</span>=<span class="summary-sig-default">True</span>,
635 <span class="summary-sig-arg">doctype</span>=<span class="summary-sig-default">None</span>)</span><br />
636 Return an HTML string representation of the document.</td>
637 <td align="right" valign="top">
638 <span class="codelink"><a href="lxml.html-pysrc.html#tostring">source code</a></span>
647 <td width="15%" align="right" valign="top" class="summary">
648 <span class="summary-type"> </span>
649 </td><td class="summary">
650 <table width="100%" cellpadding="0" cellspacing="0" border="0">
652 <td><span class="summary-sig"><a name="open_in_browser"></a><span class="summary-sig-name">open_in_browser</span>(<span class="summary-sig-arg">doc</span>,
653 <span class="summary-sig-arg">encoding</span>=<span class="summary-sig-default">None</span>)</span><br />
654 Open the HTML document in a web browser, saving it to a temporary
655 file to open it. Note that this does not delete the file after
656 use. This is mainly meant for debugging.</td>
657 <td align="right" valign="top">
658 <span class="codelink"><a href="lxml.html-pysrc.html#open_in_browser">source code</a></span>
667 <td width="15%" align="right" valign="top" class="summary">
668 <span class="summary-type"> </span>
669 </td><td class="summary">
670 <table width="100%" cellpadding="0" cellspacing="0" border="0">
672 <td><span class="summary-sig"><a href="lxml.html-module.html#Element" class="summary-sig-name">Element</a>(<span class="summary-sig-arg">*args</span>,
673 <span class="summary-sig-arg">**kw</span>)</span><br />
674 Create a new HTML Element.</td>
675 <td align="right" valign="top">
676 <span class="codelink"><a href="lxml.html-pysrc.html#Element">source code</a></span>
685 <!-- ==================== VARIABLES ==================== -->
686 <a name="section-Variables"></a>
687 <table class="summary" border="1" cellpadding="3"
688 cellspacing="0" width="100%" bgcolor="white">
689 <tr bgcolor="#70b0f0" class="table-header">
690 <td colspan="2" class="table-header">
691 <table border="0" cellpadding="0" cellspacing="0" width="100%">
693 <td align="left"><span class="table-header">Variables</span></td>
694 <td align="right" valign="top"
695 ><span class="options">[<a href="#section-Variables"
696 class="privatelink" onclick="toggle_private();"
697 >hide private</a>]</span></td>
703 <td width="15%" align="right" valign="top" class="summary">
704 <span class="summary-type"> </span>
705 </td><td class="summary">
706 <a name="XHTML_NAMESPACE"></a><span class="summary-name">XHTML_NAMESPACE</span> = <code title="'http://www.w3.org/1999/xhtml'"><code class="variable-quote">'</code><code class="variable-string">http://www.w3.org/1999/xhtml</code><code class="variable-quote">'</code></code>
710 <td width="15%" align="right" valign="top" class="summary">
711 <span class="summary-type"> </span>
712 </td><td class="summary">
713 <a href="lxml.html-module.html#_rel_links_xpath" class="summary-name" onclick="show_private();">_rel_links_xpath</a> = <code title="descendant-or-self::a[@rel]|descendant-or-self::x:a[@rel]">descendant-or-self::a[@rel]|descendant-or-s<code class="variable-ellipsis">...</code></code>
717 <td width="15%" align="right" valign="top" class="summary">
718 <span class="summary-type"> </span>
719 </td><td class="summary">
720 <a href="lxml.html-module.html#_options_xpath" class="summary-name" onclick="show_private();">_options_xpath</a> = <code title="descendant-or-self::option|descendant-or-self::x:option">descendant-or-self::option|descendant-or-self<code class="variable-ellipsis">...</code></code>
724 <td width="15%" align="right" valign="top" class="summary">
725 <span class="summary-type"> </span>
726 </td><td class="summary">
727 <a href="lxml.html-module.html#_forms_xpath" class="summary-name" onclick="show_private();">_forms_xpath</a> = <code title="descendant-or-self::form|descendant-or-self::x:form">descendant-or-self::form|descendant-or-self::x:<code class="variable-ellipsis">...</code></code>
731 <td width="15%" align="right" valign="top" class="summary">
732 <span class="summary-type"> </span>
733 </td><td class="summary">
734 <a href="lxml.html-module.html#_class_xpath" class="summary-name" onclick="show_private();">_class_xpath</a> = <code title="descendant-or-self::*[@class and contains(concat(' ', normalize-space(\
735 @class), ' '), concat(' ', $class_name, ' '))]">descendant-or-self::*[@class and contains(conca<code class="variable-ellipsis">...</code></code>
739 <td width="15%" align="right" valign="top" class="summary">
740 <span class="summary-type"> </span>
741 </td><td class="summary">
742 <a name="_id_xpath"></a><span class="summary-name">_id_xpath</span> = <code title="descendant-or-self::*[@id=$id]">descendant-or-self::*[@id=$id]</code>
746 <td width="15%" align="right" valign="top" class="summary">
747 <span class="summary-type"> </span>
748 </td><td class="summary">
749 <a name="_collect_string_content"></a><span class="summary-name">_collect_string_content</span> = <code title="string()">string()</code>
753 <td width="15%" align="right" valign="top" class="summary">
754 <span class="summary-type"> </span>
755 </td><td class="summary">
756 <a href="lxml.html-module.html#_css_url_re" class="summary-name" onclick="show_private();">_css_url_re</a> = <code title="re.compile(r'(?i)url\(("[^"]*"|\'[^\']*\'|[^\)]*)\)')">re.compile(r'<code class="re-flags">(?i)</code>url\(<code class="re-group">(</code>"<code class="re-group">[^</code>"<code class="re-group">]</code><code class="re-op">*</code>"<code class="re-op">|</code>\'<code class="re-group">[^</code>\'<code class="re-group">]</code><code class="re-op">*</code>\'<code class="re-op">|</code><code class="re-group">[^</code>\)<code class="re-group">]</code><code class="re-op">*</code><code class="variable-ellipsis">...</code></code>
760 <td width="15%" align="right" valign="top" class="summary">
761 <span class="summary-type"> </span>
762 </td><td class="summary">
763 <a name="_css_import_re"></a><span class="summary-name">_css_import_re</span> = <code title="re.compile(r'@import "(.*?)"')">re.compile(r'@import "<code class="re-group">(</code>.<code class="re-op">*?</code><code class="re-group">)</code>"')</code>
767 <td width="15%" align="right" valign="top" class="summary">
768 <span class="summary-type"> </span>
769 </td><td class="summary">
770 <a name="_label_xpath"></a><span class="summary-name">_label_xpath</span> = <code title="//label[@for=$id]|//x:label[@for=$id]">//label[@for=$id]|//x:label[@for=$id]</code>
774 <td width="15%" align="right" valign="top" class="summary">
775 <span class="summary-type"> </span>
776 </td><td class="summary">
777 <a name="_archive_re"></a><span class="summary-name">_archive_re</span> = <code title="re.compile(r'[^ ]+')">re.compile(r'<code class="re-group">[^</code> <code class="re-group">]</code><code class="re-op">+</code>')</code>
781 <td width="15%" align="right" valign="top" class="summary">
782 <span class="summary-type"> </span>
783 </td><td class="summary">
784 <a name="find_rel_links"></a><span class="summary-name">find_rel_links</span> = <code title="_MethodFunc('find_rel_links', copy= False)">_MethodFunc('find_rel_links', copy= False)</code>
788 <td width="15%" align="right" valign="top" class="summary">
789 <span class="summary-type"> </span>
790 </td><td class="summary">
791 <a name="find_class"></a><span class="summary-name">find_class</span> = <code title="_MethodFunc('find_class', copy= False)">_MethodFunc('find_class', copy= False)</code>
795 <td width="15%" align="right" valign="top" class="summary">
796 <span class="summary-type"> </span>
797 </td><td class="summary">
798 <a href="lxml.html-module.html#make_links_absolute" class="summary-name">make_links_absolute</a> = <code title="_MethodFunc('make_links_absolute', copy= True)">_MethodFunc('make_links_absolute', copy=<code class="variable-ellipsis">...</code></code>
802 <td width="15%" align="right" valign="top" class="summary">
803 <span class="summary-type"> </span>
804 </td><td class="summary">
805 <a name="resolve_base_href"></a><span class="summary-name">resolve_base_href</span> = <code title="_MethodFunc('resolve_base_href', copy= True)">_MethodFunc('resolve_base_href', copy= True)</code>
809 <td width="15%" align="right" valign="top" class="summary">
810 <span class="summary-type"> </span>
811 </td><td class="summary">
812 <a name="iterlinks"></a><span class="summary-name">iterlinks</span> = <code title="_MethodFunc('iterlinks', copy= False)">_MethodFunc('iterlinks', copy= False)</code>
816 <td width="15%" align="right" valign="top" class="summary">
817 <span class="summary-type"> </span>
818 </td><td class="summary">
819 <a name="rewrite_links"></a><span class="summary-name">rewrite_links</span> = <code title="_MethodFunc('rewrite_links', copy= True)">_MethodFunc('rewrite_links', copy= True)</code>
823 <td width="15%" align="right" valign="top" class="summary">
824 <span class="summary-type"> </span>
825 </td><td class="summary">
826 <a name="html_parser"></a><span class="summary-name">html_parser</span> = <code title="HTMLParser()">HTMLParser()</code>
830 <td width="15%" align="right" valign="top" class="summary">
831 <span class="summary-type"> </span>
832 </td><td class="summary">
833 <a name="xhtml_parser"></a><span class="summary-name">xhtml_parser</span> = <code title="XHTMLParser()">XHTMLParser()</code>
837 <td width="15%" align="right" valign="top" class="summary">
838 <span class="summary-type"> </span>
839 </td><td class="summary">
840 <a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'lxml.html'"><code class="variable-quote">'</code><code class="variable-string">lxml.html</code><code class="variable-quote">'</code></code>
844 <!-- ==================== FUNCTION DETAILS ==================== -->
845 <a name="section-FunctionDetails"></a>
846 <table class="details" border="1" cellpadding="3"
847 cellspacing="0" width="100%" bgcolor="white">
848 <tr bgcolor="#70b0f0" class="table-header">
849 <td colspan="2" class="table-header">
850 <table border="0" cellpadding="0" cellspacing="0" width="100%">
852 <td align="left"><span class="table-header">Function Details</span></td>
853 <td align="right" valign="top"
854 ><span class="options">[<a href="#section-FunctionDetails"
855 class="privatelink" onclick="toggle_private();"
856 >hide private</a>]</span></td>
862 <a name="fragments_fromstring"></a>
864 <table class="details" border="1" cellpadding="3"
865 cellspacing="0" width="100%" bgcolor="white">
867 <table width="100%" cellpadding="0" cellspacing="0" border="0">
868 <tr valign="top"><td>
869 <h3 class="epydoc"><span class="sig"><span class="sig-name">fragments_fromstring</span>(<span class="sig-arg">html</span>,
870 <span class="sig-arg">no_leading_text</span>=<span class="sig-default">False</span>,
871 <span class="sig-arg">base_url</span>=<span class="sig-default">None</span>,
872 <span class="sig-arg">parser</span>=<span class="sig-default">None</span>,
873 <span class="sig-arg">**kw</span>)</span>
875 </td><td align="right" valign="top"
876 ><span class="codelink"><a href="lxml.html-pysrc.html#fragments_fromstring">source code</a></span>
880 <p>Parses several HTML elements, returning a list of elements.</p>
881 <p>The first item in the list may be a string (though leading
882 whitespace is removed). If no_leading_text is true, then it will
883 be an error if there is leading text, and it will always be a list
884 of only elements.</p>
885 <p>base_url will set the document's base_url attribute (and the tree's docinfo.URL)</p>
890 <a name="fragment_fromstring"></a>
892 <table class="details" border="1" cellpadding="3"
893 cellspacing="0" width="100%" bgcolor="white">
895 <table width="100%" cellpadding="0" cellspacing="0" border="0">
896 <tr valign="top"><td>
897 <h3 class="epydoc"><span class="sig"><span class="sig-name">fragment_fromstring</span>(<span class="sig-arg">html</span>,
898 <span class="sig-arg">create_parent</span>=<span class="sig-default">False</span>,
899 <span class="sig-arg">base_url</span>=<span class="sig-default">None</span>,
900 <span class="sig-arg">parser</span>=<span class="sig-default">None</span>,
901 <span class="sig-arg">**kw</span>)</span>
903 </td><td align="right" valign="top"
904 ><span class="codelink"><a href="lxml.html-pysrc.html#fragment_fromstring">source code</a></span>
908 <p>Parses a single HTML element; it is an error if there is more than
909 one element, or if anything but whitespace precedes or follows the
911 <p>If create_parent is true (or is a tag name) then a parent node
912 will be created to encapsulate the HTML in a single element. In
913 this case, leading or trailing text is allowed.</p>
914 <p>base_url will set the document's base_url attribute (and the tree's docinfo.URL)</p>
919 <a name="fromstring"></a>
921 <table class="details" border="1" cellpadding="3"
922 cellspacing="0" width="100%" bgcolor="white">
924 <table width="100%" cellpadding="0" cellspacing="0" border="0">
925 <tr valign="top"><td>
926 <h3 class="epydoc"><span class="sig"><span class="sig-name">fromstring</span>(<span class="sig-arg">html</span>,
927 <span class="sig-arg">base_url</span>=<span class="sig-default">None</span>,
928 <span class="sig-arg">parser</span>=<span class="sig-default">None</span>,
929 <span class="sig-arg">**kw</span>)</span>
931 </td><td align="right" valign="top"
932 ><span class="codelink"><a href="lxml.html-pysrc.html#fromstring">source code</a></span>
936 <p>Parse the html, returning a single element/document.</p>
937 <p>This tries to minimally parse the chunk of text, without knowing if it
938 is a fragment or a document.</p>
939 <p>base_url will set the document's base_url attribute (and the tree's docinfo.URL)</p>
946 <table class="details" border="1" cellpadding="3"
947 cellspacing="0" width="100%" bgcolor="white">
949 <table width="100%" cellpadding="0" cellspacing="0" border="0">
950 <tr valign="top"><td>
951 <h3 class="epydoc"><span class="sig"><span class="sig-name">parse</span>(<span class="sig-arg">filename_or_url</span>,
952 <span class="sig-arg">parser</span>=<span class="sig-default">None</span>,
953 <span class="sig-arg">base_url</span>=<span class="sig-default">None</span>,
954 <span class="sig-arg">**kw</span>)</span>
956 </td><td align="right" valign="top"
957 ><span class="codelink"><a href="lxml.html-pysrc.html#parse">source code</a></span>
961 <p>Parse a filename, URL, or file-like object into an HTML document
962 tree. Note: this returns a tree, not an element. Use
963 <tt class="rst-rst-docutils literal rst-docutils literal"><span class="pre">parse(...).getroot()</span></tt> to get the document root.</p>
964 <p>You can override the base URL with the <tt class="rst-docutils literal">base_url</tt> keyword. This
965 is most useful when parsing from a file-like object.</p>
970 <a name="submit_form"></a>
972 <table class="details" border="1" cellpadding="3"
973 cellspacing="0" width="100%" bgcolor="white">
975 <table width="100%" cellpadding="0" cellspacing="0" border="0">
976 <tr valign="top"><td>
977 <h3 class="epydoc"><span class="sig"><span class="sig-name">submit_form</span>(<span class="sig-arg">form</span>,
978 <span class="sig-arg">extra_values</span>=<span class="sig-default">None</span>,
979 <span class="sig-arg">open_http</span>=<span class="sig-default">None</span>)</span>
981 </td><td align="right" valign="top"
982 ><span class="codelink"><a href="lxml.html-pysrc.html#submit_form">source code</a></span>
986 <p>Helper function to submit a form. Returns a file-like object, as from
987 <tt class="rst-rst-docutils literal rst-docutils literal">urllib.urlopen()</tt>. This object also has a <tt class="rst-rst-docutils literal rst-docutils literal">.geturl()</tt> function,
988 which shows the URL if there were any redirects.</p>
989 <p>You can use this like:</p>
990 <pre class="rst-literal-block">
992 form.inputs['foo'].value = 'bar' # etc
993 response = form.submit()
994 doc = parse(response)
995 doc.make_links_absolute(response.geturl())
997 <p>To change the HTTP requester, pass a function as <tt class="rst-docutils literal">open_http</tt> keyword
998 argument that opens the URL for you. The function must have the following
1000 <pre class="rst-literal-block">
1001 open_http(method, URL, values)
1003 <p>The action is one of 'GET' or 'POST', the URL is the target URL as a
1004 string, and the values are a sequence of <tt class="rst-docutils literal">(name, value)</tt> tuples with the
1010 <a name="tostring"></a>
1012 <table class="details" border="1" cellpadding="3"
1013 cellspacing="0" width="100%" bgcolor="white">
1015 <table width="100%" cellpadding="0" cellspacing="0" border="0">
1016 <tr valign="top"><td>
1017 <h3 class="epydoc"><span class="sig"><span class="sig-name">tostring</span>(<span class="sig-arg">doc</span>,
1018 <span class="sig-arg">pretty_print</span>=<span class="sig-default">False</span>,
1019 <span class="sig-arg">include_meta_content_type</span>=<span class="sig-default">False</span>,
1020 <span class="sig-arg">encoding</span>=<span class="sig-default">None</span>,
1021 <span class="sig-arg">method</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">html</code><code class="variable-quote">'</code></span>,
1022 <span class="sig-arg">with_tail</span>=<span class="sig-default">True</span>,
1023 <span class="sig-arg">doctype</span>=<span class="sig-default">None</span>)</span>
1025 </td><td align="right" valign="top"
1026 ><span class="codelink"><a href="lxml.html-pysrc.html#tostring">source code</a></span>
1030 <p>Return an HTML string representation of the document.</p>
1031 <p>Note: if include_meta_content_type is true this will create a
1032 <tt class="rst-docutils literal"><meta <span class="pre">http-equiv="Content-Type"</span> <span class="pre">...></span></tt> tag in the head;
1033 regardless of the value of include_meta_content_type any existing
1034 <tt class="rst-docutils literal"><meta <span class="pre">http-equiv="Content-Type"</span> <span class="pre">...></span></tt> tag will be removed</p>
1035 <p>The <tt class="rst-docutils literal">encoding</tt> argument controls the output encoding (defauts to
1036 ASCII, with &#...; character references for any characters outside
1037 of ASCII). Note that you can pass the name <tt class="rst-docutils literal">'unicode'</tt> as
1038 <tt class="rst-docutils literal">encoding</tt> argument to serialise to a unicode string.</p>
1039 <p>The <tt class="rst-docutils literal">method</tt> argument defines the output method. It defaults to
1040 'html', but can also be 'xml' for xhtml output, or 'text' to
1041 serialise to plain text without markup.</p>
1042 <p>To leave out the tail text of the top-level element that is being
1043 serialised, pass <tt class="rst-docutils literal">with_tail=False</tt>.</p>
1044 <p>The <tt class="rst-docutils literal">doctype</tt> option allows passing in a plain string that will
1045 be serialised before the XML tree. Note that passing in non
1046 well-formed content here will make the XML output non well-formed.
1047 Also, an existing doctype in the document tree will not be removed
1048 when serialising an ElementTree instance.</p>
1050 <pre class="rst-literal-block">
1051 >>> from lxml import html
1052 >>> root = html.fragment_fromstring('<p>Hello<br>world!</p>')
1054 >>> html.tostring(root)
1055 '<p>Hello<br>world!</p>'
1056 >>> html.tostring(root, method='html')
1057 '<p>Hello<br>world!</p>'
1059 >>> html.tostring(root, method='xml')
1060 '<p>Hello<br/>world!</p>'
1062 >>> html.tostring(root, method='text')
1065 >>> html.tostring(root, method='text', encoding=unicode)
1068 >>> root = html.fragment_fromstring('<div><p>Hello<br>world!</p>TAIL</div>')
1069 >>> html.tostring(root[0], method='text', encoding=unicode)
1072 >>> html.tostring(root[0], method='text', encoding=unicode, with_tail=False)
1075 >>> doc = html.document_fromstring('<p>Hello<br>world!</p>')
1076 >>> html.tostring(doc, method='html', encoding=unicode)
1077 u'<html><body><p>Hello<br>world!</p></body></html>'
1079 >>> print(html.tostring(doc, method='html', encoding=unicode,
1080 ... doctype='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"'
1081 ... ' "http://www.w3.org/TR/html4/strict.dtd">'))
1082 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
1083 <html><body><p>Hello<br>world!</p></body></html>
1089 <a name="Element"></a>
1091 <table class="details" border="1" cellpadding="3"
1092 cellspacing="0" width="100%" bgcolor="white">
1094 <table width="100%" cellpadding="0" cellspacing="0" border="0">
1095 <tr valign="top"><td>
1096 <h3 class="epydoc"><span class="sig"><span class="sig-name">Element</span>(<span class="sig-arg">*args</span>,
1097 <span class="sig-arg">**kw</span>)</span>
1099 </td><td align="right" valign="top"
1100 ><span class="codelink"><a href="lxml.html-pysrc.html#Element">source code</a></span>
1104 <p>Create a new HTML Element.</p>
1105 <p>This can also be used for XHTML documents.</p>
1111 <!-- ==================== VARIABLES DETAILS ==================== -->
1112 <a name="section-VariablesDetails"></a>
1113 <table class="details" border="1" cellpadding="3"
1114 cellspacing="0" width="100%" bgcolor="white">
1115 <tr bgcolor="#70b0f0" class="table-header">
1116 <td colspan="2" class="table-header">
1117 <table border="0" cellpadding="0" cellspacing="0" width="100%">
1119 <td align="left"><span class="table-header">Variables Details</span></td>
1120 <td align="right" valign="top"
1121 ><span class="options">[<a href="#section-VariablesDetails"
1122 class="privatelink" onclick="toggle_private();"
1123 >hide private</a>]</span></td>
1129 <a name="_rel_links_xpath"></a>
1130 <div class="private">
1131 <table class="details" border="1" cellpadding="3"
1132 cellspacing="0" width="100%" bgcolor="white">
1134 <h3 class="epydoc">_rel_links_xpath</h3>
1140 <dd><table><tr><td><pre class="variable">
1141 descendant-or-self::a[@rel]|descendant-or-self::x:a[@rel]
1142 </pre></td></tr></table>
1147 <a name="_options_xpath"></a>
1148 <div class="private">
1149 <table class="details" border="1" cellpadding="3"
1150 cellspacing="0" width="100%" bgcolor="white">
1152 <h3 class="epydoc">_options_xpath</h3>
1158 <dd><table><tr><td><pre class="variable">
1159 descendant-or-self::option|descendant-or-self::x:option
1160 </pre></td></tr></table>
1165 <a name="_forms_xpath"></a>
1166 <div class="private">
1167 <table class="details" border="1" cellpadding="3"
1168 cellspacing="0" width="100%" bgcolor="white">
1170 <h3 class="epydoc">_forms_xpath</h3>
1176 <dd><table><tr><td><pre class="variable">
1177 descendant-or-self::form|descendant-or-self::x:form
1178 </pre></td></tr></table>
1183 <a name="_class_xpath"></a>
1184 <div class="private">
1185 <table class="details" border="1" cellpadding="3"
1186 cellspacing="0" width="100%" bgcolor="white">
1188 <h3 class="epydoc">_class_xpath</h3>
1194 <dd><table><tr><td><pre class="variable">
1195 descendant-or-self::*[@class and contains(concat(' ', normalize-space(<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
1196 @class), ' '), concat(' ', $class_name, ' '))]
1197 </pre></td></tr></table>
1202 <a name="_css_url_re"></a>
1203 <div class="private">
1204 <table class="details" border="1" cellpadding="3"
1205 cellspacing="0" width="100%" bgcolor="white">
1207 <h3 class="epydoc">_css_url_re</h3>
1213 <dd><table><tr><td><pre class="variable">
1214 re.compile(r'<code class="re-flags">(?i)</code>url\(<code class="re-group">(</code>"<code class="re-group">[^</code>"<code class="re-group">]</code><code class="re-op">*</code>"<code class="re-op">|</code>\'<code class="re-group">[^</code>\'<code class="re-group">]</code><code class="re-op">*</code>\'<code class="re-op">|</code><code class="re-group">[^</code>\)<code class="re-group">]</code><code class="re-op">*</code><code class="re-group">)</code>\)')
1215 </pre></td></tr></table>
1220 <a name="make_links_absolute"></a>
1222 <table class="details" border="1" cellpadding="3"
1223 cellspacing="0" width="100%" bgcolor="white">
1225 <h3 class="epydoc">make_links_absolute</h3>
1231 <dd><table><tr><td><pre class="variable">
1232 _MethodFunc('make_links_absolute', copy= True)
1233 </pre></td></tr></table>
1239 <!-- ==================== NAVIGATION BAR ==================== -->
1240 <table class="navbar" border="0" width="100%" cellpadding="0"
1241 bgcolor="#a0c0ff" cellspacing="0">
1242 <tr valign="middle">
1244 <th> <a
1245 href="lxml-module.html">Home</a> </th>
1248 <th> <a
1249 href="module-tree.html">Trees</a> </th>
1252 <th> <a
1253 href="identifier-index.html">Indices</a> </th>
1256 <th> <a
1257 href="help.html">Help</a> </th>
1259 <!-- Project homepage -->
1260 <th class="navbar" align="right" width="100%">
1261 <table border="0" cellpadding="0" cellspacing="0">
1262 <tr><th class="navbar" align="center"
1263 ><a class="navbar" target="_top" href="/">lxml API</a></th>
1267 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
1269 <td align="left" class="footer">
1270 Generated by Epydoc 3.0.1 on Tue Jul 31 10:14:17 2012
1272 <td align="right" class="footer">
1273 <a target="mainFrame" href="http://epydoc.sourceforge.net"
1274 >http://epydoc.sourceforge.net</a>
1279 <script type="text/javascript">
1281 // Private objects are initially displayed (because if
1282 // javascript is turned off then we want them to be
1283 // visible); but by default, we want to hide them. So hide
1284 // them unless we have a cookie that says to show them.