File: qwebelement.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (242 lines) | stat: -rw-r--r-- 39,787 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QWebElement Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QWebElement Class Reference<br /><sup><sup>[<a href="qtwebkit.html">QtWebKit</a> module]</sup></sup></h1><p>The QWebElement class provides convenient access to DOM elements in a <a href="qwebframe.html">QWebFrame</a>. <a href="#details">More...</a></p>
<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qwebelement.html#StyleResolveStrategy-enum">StyleResolveStrategy</a></b> { InlineStyle, CascadedStyle, ComputedStyle }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qwebelement.html#QWebElement">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebelement.html#QWebElement-2">__init__</a></b> (<i>self</i>, QWebElement)</li><li><div class="fn" /><b><a href="qwebelement.html#addClass">addClass</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#appendInside">appendInside</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#appendInside-2">appendInside</a></b> (<i>self</i>, QWebElement)</li><li><div class="fn" /><b><a href="qwebelement.html#appendOutside">appendOutside</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#appendOutside-2">appendOutside</a></b> (<i>self</i>, QWebElement)</li><li><div class="fn" />QString <b><a href="qwebelement.html#attribute">attribute</a></b> (<i>self</i>, QString, QString&#160;<i>defaultValue</i>&#160;=&#160;QString())</li><li><div class="fn" />QStringList <b><a href="qwebelement.html#attributeNames">attributeNames</a></b> (<i>self</i>, QString&#160;<i>namespaceUri</i>&#160;=&#160;QString())</li><li><div class="fn" />QString <b><a href="qwebelement.html#attributeNS">attributeNS</a></b> (<i>self</i>, QString, QString, QString&#160;<i>defaultValue</i>&#160;=&#160;QString())</li><li><div class="fn" />QStringList <b><a href="qwebelement.html#classes">classes</a></b> (<i>self</i>)</li><li><div class="fn" />QWebElement <b><a href="qwebelement.html#clone">clone</a></b> (<i>self</i>)</li><li><div class="fn" />QWebElement <b><a href="qwebelement.html#document">document</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebelement.html#encloseContentsWith">encloseContentsWith</a></b> (<i>self</i>, QWebElement)</li><li><div class="fn" /><b><a href="qwebelement.html#encloseContentsWith-2">encloseContentsWith</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#encloseWith">encloseWith</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#encloseWith-2">encloseWith</a></b> (<i>self</i>, QWebElement)</li><li><div class="fn" />QVariant <b><a href="qwebelement.html#evaluateJavaScript">evaluateJavaScript</a></b> (<i>self</i>, QString)</li><li><div class="fn" />QWebElementCollection <b><a href="qwebelement.html#findAll">findAll</a></b> (<i>self</i>, QString)</li><li><div class="fn" />QWebElement <b><a href="qwebelement.html#findFirst">findFirst</a></b> (<i>self</i>, QString)</li><li><div class="fn" />QWebElement <b><a href="qwebelement.html#firstChild">firstChild</a></b> (<i>self</i>)</li><li><div class="fn" />QRect <b><a href="qwebelement.html#geometry">geometry</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qwebelement.html#hasAttribute">hasAttribute</a></b> (<i>self</i>, QString)</li><li><div class="fn" />bool <b><a href="qwebelement.html#hasAttributeNS">hasAttributeNS</a></b> (<i>self</i>, QString, QString)</li><li><div class="fn" />bool <b><a href="qwebelement.html#hasAttributes">hasAttributes</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qwebelement.html#hasClass">hasClass</a></b> (<i>self</i>, QString)</li><li><div class="fn" />bool <b><a href="qwebelement.html#hasFocus">hasFocus</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qwebelement.html#isNull">isNull</a></b> (<i>self</i>)</li><li><div class="fn" />QWebElement <b><a href="qwebelement.html#lastChild">lastChild</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qwebelement.html#localName">localName</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qwebelement.html#namespaceUri">namespaceUri</a></b> (<i>self</i>)</li><li><div class="fn" />QWebElement <b><a href="qwebelement.html#nextSibling">nextSibling</a></b> (<i>self</i>)</li><li><div class="fn" />QWebElement <b><a href="qwebelement.html#parent">parent</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qwebelement.html#prefix">prefix</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebelement.html#prependInside">prependInside</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#prependInside-2">prependInside</a></b> (<i>self</i>, QWebElement)</li><li><div class="fn" /><b><a href="qwebelement.html#prependOutside">prependOutside</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#prependOutside-2">prependOutside</a></b> (<i>self</i>, QWebElement)</li><li><div class="fn" />QWebElement <b><a href="qwebelement.html#previousSibling">previousSibling</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebelement.html#removeAllChildren">removeAllChildren</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebelement.html#removeAttribute">removeAttribute</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#removeAttributeNS">removeAttributeNS</a></b> (<i>self</i>, QString, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#removeClass">removeClass</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#removeFromDocument">removeFromDocument</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebelement.html#render">render</a></b> (<i>self</i>, QPainter)</li><li><div class="fn" /><b><a href="qwebelement.html#replace">replace</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#replace-2">replace</a></b> (<i>self</i>, QWebElement)</li><li><div class="fn" /><b><a href="qwebelement.html#setAttribute">setAttribute</a></b> (<i>self</i>, QString, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#setAttributeNS">setAttributeNS</a></b> (<i>self</i>, QString, QString, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#setFocus">setFocus</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebelement.html#setInnerXml">setInnerXml</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#setOuterXml">setOuterXml</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#setPlainText">setPlainText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qwebelement.html#setStyleProperty">setStyleProperty</a></b> (<i>self</i>, QString, QString)</li><li><div class="fn" />QString <b><a href="qwebelement.html#styleProperty">styleProperty</a></b> (<i>self</i>, QString, StyleResolveStrategy)</li><li><div class="fn" />QString <b><a href="qwebelement.html#tagName">tagName</a></b> (<i>self</i>)</li><li><div class="fn" />QWebElement <b><a href="qwebelement.html#takeFromDocument">takeFromDocument</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebelement.html#toggleClass">toggleClass</a></b> (<i>self</i>, QString)</li><li><div class="fn" />QString <b><a href="qwebelement.html#toInnerXml">toInnerXml</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qwebelement.html#toOuterXml">toOuterXml</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qwebelement.html#toPlainText">toPlainText</a></b> (<i>self</i>)</li><li><div class="fn" />QWebFrame <b><a href="qwebelement.html#webFrame">webFrame</a></b> (<i>self</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qwebelement.html#__eq__">__eq__</a></b> (<i>self</i>, QWebElement)</li><li><div class="fn" />bool <b><a href="qwebelement.html#__ne__">__ne__</a></b> (<i>self</i>, QWebElement)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QWebElement class provides convenient access to DOM elements in a <a href="qwebframe.html">QWebFrame</a>.</p>
<p>A QWebElement object allows easy access to the document model, represented by a tree-like structure of DOM elements. The root of the tree is called the document element and can be accessed using <a href="qwebframe.html#documentElement">QWebFrame.documentElement</a>().</p>
<p>Specific elements can be accessed using <a href="qwebelement.html#findAll">findAll</a>() and <a href="qwebelement.html#findFirst">findFirst</a>(). These elements are identified using CSS selectors. The code snippet below demonstrates the use of <a href="qwebelement.html#findAll">findAll</a>().</p>
<pre>     QWebElement document = frame-&gt;documentElement();
     <span class="comment">/* Assume the document has the following structure:

        &lt;p class=intro&gt;
          &lt;span&gt;Intro&lt;/span&gt;
          &lt;span&gt;Snippets&lt;/span&gt;
        &lt;/p&gt;
        &lt;p&gt;
          &lt;span&gt;Content&lt;/span&gt;
          &lt;span&gt;Here&lt;/span&gt;
        &lt;/p&gt;
     */</span>

     QList&lt;QWebElement&gt; allSpans = document.findAll("span");
     QList&lt;QWebElement&gt; introSpans = document.findAll("p.intro span");</pre>
<p>The first list contains all <tt>span</tt> elements in the document. The second list contains <tt>span</tt> elements that are children of <tt>p</tt>, classified with <tt>intro</tt>.</p>
<p>Using <a href="qwebelement.html#findFirst">findFirst</a>() is more efficient than calling <a href="qwebelement.html#findAll">findAll</a>(), and extracting the first element only in the list returned.</p>
<p>Alternatively you can traverse the document manually using <a href="qwebelement.html#firstChild">firstChild</a>() and <a href="qwebelement.html#nextSibling">nextSibling</a>():</p>
<pre>     frame-&gt;setHtml("&lt;html&gt;&lt;body&gt;&lt;p&gt;First Paragraph&lt;/p&gt;&lt;p&gt;Second Paragraph&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;");
     QWebElement doc = frame-&gt;documentElement();
     QWebElement body = doc.firstChild();
     QWebElement firstParagraph = body.firstChild();
     QWebElement secondParagraph = firstParagraph.nextSibling();</pre>
<p>The underlying content of QWebElement is explicitly shared. Creating a copy of a QWebElement does not create a copy of the content. Instead, both instances point to the same element.</p>
<p>The element's attributes can be read using <a href="qwebelement.html#attribute">attribute</a>() and modified with <a href="qwebelement.html#setAttribute">setAttribute</a>().</p>
<p>The contents of child elements can be converted to plain text with <a href="qwebelement.html#toPlainText">toPlainText</a>(); to XHTML using <a href="qwebelement.html#toInnerXml">toInnerXml</a>(). To include the element's tag in the output, use <a href="qwebelement.html#toOuterXml">toOuterXml</a>().</p>
<p>It is possible to replace the contents of child elements using <a href="qwebelement.html#setPlainText">setPlainText</a>() and <a href="qwebelement.html#setInnerXml">setInnerXml</a>(). To replace the element itself and its contents, use <a href="qwebelement.html#setOuterXml">setOuterXml</a>().</p>
<a name="examples" />
<h3>Examples</h3>
<p>The <a href="webkit-domtraversal.html">DOM Traversal Example</a> shows one way to traverse documents in a running example.</p>
<p>The <a href="webkit-simpleselector.html">Simple Selector Example</a> can be used to experiment with the searching features of this class and provides sample code you can start working with.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="StyleResolveStrategy-enum" />QWebElement.StyleResolveStrategy</h3><p>This enum describes how <a href="qwebelement.html">QWebElement</a>'s styleProperty resolves the given property name.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QWebElement.InlineStyle</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Return the property value as it is defined in the element, without respecting style inheritance and other CSS rules.</td></tr>
<tr><td valign="top"><tt>QWebElement.CascadedStyle</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The property's value is determined using the inheritance and importance rules defined in the document's stylesheet.</td></tr>
<tr><td valign="top"><tt>QWebElement.ComputedStyle</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">The property's value is the absolute value of the style property resolved from the environment.</td></tr>
</table></p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QWebElement" />QWebElement.__init__ (<i>self</i>)</h3><p>Constructs a null web element.</p>
<h3 class="fn"><a name="QWebElement-2" />QWebElement.__init__ (<i>self</i>, <a href="qwebelement.html">QWebElement</a>)</h3><p>Constructs a copy of <i>other</i>.</p>
<a name="//apple_ref/cpp/instm/QWebElement/~QWebElement" />
<h3 class="fn"><a name="addClass" />QWebElement.addClass (<i>self</i>, QString)</h3><p>Adds the specified class with the given <i>name</i> to the element.</p>
<a name="//apple_ref/cpp/instm/QWebElement/appendInside" />
<h3 class="fn"><a name="appendInside" />QWebElement.appendInside (<i>self</i>, QString)</h3><p>Appends the result of parsing <i>markup</i> as the element's last child.</p>
<p>Calling this function on a null element does nothing.</p>
<p>See also <a href="qwebelement.html#prependInside">prependInside</a>(), <a href="qwebelement.html#prependOutside">prependOutside</a>(), and <a href="qwebelement.html#appendOutside">appendOutside</a>().</p>
<h3 class="fn"><a name="appendInside-2" />QWebElement.appendInside (<i>self</i>, <a href="qwebelement.html">QWebElement</a>)</h3><p>Appends the given <i>element</i> as the element's last child.</p>
<p>If <i>element</i> is the child of another element, it is re-parented to this element. If <i>element</i> is a child of this element, then its position in the list of children is changed.</p>
<p>Calling this function on a null element does nothing.</p>
<p>See also <a href="qwebelement.html#prependInside">prependInside</a>(), <a href="qwebelement.html#prependOutside">prependOutside</a>(), and <a href="qwebelement.html#appendOutside">appendOutside</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/appendOutside" />
<h3 class="fn"><a name="appendOutside" />QWebElement.appendOutside (<i>self</i>, QString)</h3><p>Inserts the result of parsing <i>markup</i> after this element.</p>
<p>Calling this function on a null element does nothing.</p>
<p>See also <a href="qwebelement.html#appendInside">appendInside</a>(), <a href="qwebelement.html#prependInside">prependInside</a>(), and <a href="qwebelement.html#prependOutside">prependOutside</a>().</p>
<h3 class="fn"><a name="appendOutside-2" />QWebElement.appendOutside (<i>self</i>, <a href="qwebelement.html">QWebElement</a>)</h3><p>Inserts the given <i>element</i> after this element.</p>
<p>If <i>element</i> is the child of another element, it is re-parented to the parent of this element.</p>
<p>Calling this function on a null element does nothing.</p>
<p>See also <a href="qwebelement.html#appendInside">appendInside</a>(), <a href="qwebelement.html#prependInside">prependInside</a>(), and <a href="qwebelement.html#prependOutside">prependOutside</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/attribute" />
<h3 class="fn"><a name="attribute" />QString QWebElement.attribute (<i>self</i>, QString, QString&#160;<i>defaultValue</i>&#160;=&#160;QString())</h3><p>Returns the attribute with the given <i>name</i>. If the attribute does not exist, <i>defaultValue</i> is returned.</p>
<p>See also <a href="qwebelement.html#setAttribute">setAttribute</a>(), <a href="qwebelement.html#setAttributeNS">setAttributeNS</a>(), and <a href="qwebelement.html#attributeNS">attributeNS</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/attributeNS" />
<h3 class="fn"><a name="attributeNames" />QStringList QWebElement.attributeNames (<i>self</i>, QString&#160;<i>namespaceUri</i>&#160;=&#160;QString())</h3><p>Return the list of attributes for the namespace given as <i>namespaceUri</i>.</p>
<p>See also <a href="qwebelement.html#attribute">attribute</a>() and <a href="qwebelement.html#setAttribute">setAttribute</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/classes" />
<h3 class="fn"><a name="attributeNS" />QString QWebElement.attributeNS (<i>self</i>, QString, QString, QString&#160;<i>defaultValue</i>&#160;=&#160;QString())</h3><p>Returns the attribute with the given <i>name</i> in <i>namespaceUri</i>. If the attribute does not exist, <i>defaultValue</i> is returned.</p>
<p>See also <a href="qwebelement.html#setAttributeNS">setAttributeNS</a>(), <a href="qwebelement.html#setAttribute">setAttribute</a>(), and <a href="qwebelement.html#attribute">attribute</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/attributeNames" />
<h3 class="fn"><a name="classes" />QStringList QWebElement.classes (<i>self</i>)</h3><p>Returns the list of classes of this element.</p>
<a name="//apple_ref/cpp/instm/QWebElement/clone" />
<h3 class="fn"><a name="clone" /><a href="qwebelement.html">QWebElement</a> QWebElement.clone (<i>self</i>)</h3><p>Returns a clone of this element.</p>
<p>The clone may be inserted at any point in the document.</p>
<p>See also <a href="qwebelement.html#appendInside">appendInside</a>(), <a href="qwebelement.html#prependInside">prependInside</a>(), <a href="qwebelement.html#prependOutside">prependOutside</a>(), and <a href="qwebelement.html#appendOutside">appendOutside</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/document" />
<h3 class="fn"><a name="document" /><a href="qwebelement.html">QWebElement</a> QWebElement.document (<i>self</i>)</h3><p>Returns the document which this element belongs to.</p>
<a name="//apple_ref/cpp/instm/QWebElement/encloseContentsWith" />
<h3 class="fn"><a name="encloseContentsWith" />QWebElement.encloseContentsWith (<i>self</i>, <a href="qwebelement.html">QWebElement</a>)</h3><p>Encloses the contents of this element with <i>element</i>. This element becomes the child of the deepest descendant within <i>element</i>.</p>
<p>### illustration</p>
<p>See also <a href="qwebelement.html#encloseWith">encloseWith</a>().</p>
<h3 class="fn"><a name="encloseContentsWith-2" />QWebElement.encloseContentsWith (<i>self</i>, QString)</h3><p>Encloses the contents of this element with the result of parsing <i>markup</i>. This element becomes the child of the deepest descendant within <i>markup</i>.</p>
<p>See also <a href="qwebelement.html#encloseWith">encloseWith</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/encloseWith" />
<h3 class="fn"><a name="encloseWith" />QWebElement.encloseWith (<i>self</i>, QString)</h3><p>Encloses this element with the result of parsing <i>markup</i>. This element becomes the child of the deepest descendant within <i>markup</i>.</p>
<p>See also <a href="qwebelement.html#replace">replace</a>().</p>
<h3 class="fn"><a name="encloseWith-2" />QWebElement.encloseWith (<i>self</i>, <a href="qwebelement.html">QWebElement</a>)</h3><p>Encloses this element with <i>element</i>. This element becomes the child of the deepest descendant within <i>element</i>.</p>
<p>See also <a href="qwebelement.html#replace">replace</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/evaluateJavaScript" />
<h3 class="fn"><a name="evaluateJavaScript" />QVariant QWebElement.evaluateJavaScript (<i>self</i>, QString)</h3><p>Executes <i>scriptSource</i> with this element as <tt>this</tt> object.</p>
<a name="//apple_ref/cpp/instm/QWebElement/findAll" />
<h3 class="fn"><a name="findAll" /><a href="qwebelementcollection.html">QWebElementCollection</a> QWebElement.findAll (<i>self</i>, QString)</h3><p>Returns a new list of child elements matching the given CSS selector <i>selectorQuery</i>. If there are no matching elements, an empty list is returned.</p>
<p><a href="http://www.w3.org/TR/REC-CSS2/selector.html#q1">Standard CSS2 selector</a> syntax is used for the query.</p>
<p><b>Note:</b> This search is performed recursively.</p>
<p>See also <a href="qwebelement.html#findFirst">findFirst</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/findFirst" />
<h3 class="fn"><a name="findFirst" /><a href="qwebelement.html">QWebElement</a> QWebElement.findFirst (<i>self</i>, QString)</h3><p>Returns the first child element that matches the given CSS selector <i>selectorQuery</i>.</p>
<p><a href="http://www.w3.org/TR/REC-CSS2/selector.html#q1">Standard CSS2 selector</a> syntax is used for the query.</p>
<p><b>Note:</b> This search is performed recursively.</p>
<p>See also <a href="qwebelement.html#findAll">findAll</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/firstChild" />
<h3 class="fn"><a name="firstChild" /><a href="qwebelement.html">QWebElement</a> QWebElement.firstChild (<i>self</i>)</h3><p>Returns the element's first child.</p>
<p>See also <a href="qwebelement.html#lastChild">lastChild</a>(), <a href="qwebelement.html#previousSibling">previousSibling</a>(), and <a href="qwebelement.html#nextSibling">nextSibling</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/geometry" />
<h3 class="fn"><a name="geometry" /><a href="qrect.html">QRect</a> QWebElement.geometry (<i>self</i>)</h3><p>Returns the geometry of this element, relative to its containing frame.</p>
<p>See also <a href="qwebelement.html#tagName">tagName</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/hasAttribute" />
<h3 class="fn"><a name="hasAttribute" />bool QWebElement.hasAttribute (<i>self</i>, QString)</h3><p>Returns true if this element has an attribute with the given <i>name</i>; otherwise returns false.</p>
<p>See also <a href="qwebelement.html#attribute">attribute</a>() and <a href="qwebelement.html#setAttribute">setAttribute</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/hasAttributeNS" />
<h3 class="fn"><a name="hasAttributeNS" />bool QWebElement.hasAttributeNS (<i>self</i>, QString, QString)</h3><p>Returns true if this element has an attribute with the given <i>name</i>, in <i>namespaceUri</i>; otherwise returns false.</p>
<p>See also <a href="qwebelement.html#attributeNS">attributeNS</a>() and <a href="qwebelement.html#setAttributeNS">setAttributeNS</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/hasAttributes" />
<h3 class="fn"><a name="hasAttributes" />bool QWebElement.hasAttributes (<i>self</i>)</h3><p>Returns true if the element has any attributes defined; otherwise returns false;</p>
<p>See also <a href="qwebelement.html#attribute">attribute</a>() and <a href="qwebelement.html#setAttribute">setAttribute</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/hasClass" />
<h3 class="fn"><a name="hasClass" />bool QWebElement.hasClass (<i>self</i>, QString)</h3><p>Returns true if this element has a class with the given <i>name</i>; otherwise returns false.</p>
<a name="//apple_ref/cpp/instm/QWebElement/hasFocus" />
<h3 class="fn"><a name="hasFocus" />bool QWebElement.hasFocus (<i>self</i>)</h3><p>Returns true if the element has keyboard input focus; otherwise, returns false</p>
<p>See also <a href="qwebelement.html#setFocus">setFocus</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/isNull" />
<h3 class="fn"><a name="isNull" />bool QWebElement.isNull (<i>self</i>)</h3><p>Returns true if the element is a null element; otherwise returns false.</p>
<a name="//apple_ref/cpp/instm/QWebElement/lastChild" />
<h3 class="fn"><a name="lastChild" /><a href="qwebelement.html">QWebElement</a> QWebElement.lastChild (<i>self</i>)</h3><p>Returns the element's last child.</p>
<p>See also <a href="qwebelement.html#firstChild">firstChild</a>(), <a href="qwebelement.html#previousSibling">previousSibling</a>(), and <a href="qwebelement.html#nextSibling">nextSibling</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/localName" />
<h3 class="fn"><a name="localName" />QString QWebElement.localName (<i>self</i>)</h3><p>Returns the local name of the element. If the element does not use namespaces, an empty string is returned.</p>
<a name="//apple_ref/cpp/instm/QWebElement/namespaceUri" />
<h3 class="fn"><a name="namespaceUri" />QString QWebElement.namespaceUri (<i>self</i>)</h3><h3 class="fn"><a name="nextSibling" /><a href="qwebelement.html">QWebElement</a> QWebElement.nextSibling (<i>self</i>)</h3><p>Returns the element's next sibling.</p>
<p>See also <a href="qwebelement.html#firstChild">firstChild</a>(), <a href="qwebelement.html#previousSibling">previousSibling</a>(), and <a href="qwebelement.html#lastChild">lastChild</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/parent" />
<h3 class="fn"><a name="parent" /><a href="qwebelement.html">QWebElement</a> QWebElement.parent (<i>self</i>)</h3><p>Returns the parent element of this elemen. If this element is the root document element, a null element is returned.</p>
<a name="//apple_ref/cpp/instm/QWebElement/prefix" />
<h3 class="fn"><a name="prefix" />QString QWebElement.prefix (<i>self</i>)</h3><p>Returns the namespace prefix of the element. If the element has no namespace prefix, empty string is returned.</p>
<a name="//apple_ref/cpp/instm/QWebElement/prependInside" />
<h3 class="fn"><a name="prependInside" />QWebElement.prependInside (<i>self</i>, QString)</h3><p>Prepends the result of parsing <i>markup</i> as the element's first child.</p>
<p>Calling this function on a null element does nothing.</p>
<p>See also <a href="qwebelement.html#appendInside">appendInside</a>(), <a href="qwebelement.html#prependOutside">prependOutside</a>(), and <a href="qwebelement.html#appendOutside">appendOutside</a>().</p>
<h3 class="fn"><a name="prependInside-2" />QWebElement.prependInside (<i>self</i>, <a href="qwebelement.html">QWebElement</a>)</h3><p>Prepends <i>element</i> as the element's first child.</p>
<p>If <i>element</i> is the child of another element, it is re-parented to this element. If <i>element</i> is a child of this element, then its position in the list of children is changed.</p>
<p>Calling this function on a null element does nothing.</p>
<p>See also <a href="qwebelement.html#appendInside">appendInside</a>(), <a href="qwebelement.html#prependOutside">prependOutside</a>(), and <a href="qwebelement.html#appendOutside">appendOutside</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/prependOutside" />
<h3 class="fn"><a name="prependOutside" />QWebElement.prependOutside (<i>self</i>, QString)</h3><p>Inserts the result of parsing <i>markup</i> before this element.</p>
<p>Calling this function on a null element does nothing.</p>
<p>See also <a href="qwebelement.html#appendInside">appendInside</a>(), <a href="qwebelement.html#prependInside">prependInside</a>(), and <a href="qwebelement.html#appendOutside">appendOutside</a>().</p>
<h3 class="fn"><a name="prependOutside-2" />QWebElement.prependOutside (<i>self</i>, <a href="qwebelement.html">QWebElement</a>)</h3><p>Inserts the given <i>element</i> before this element.</p>
<p>If <i>element</i> is the child of another element, it is re-parented to the parent of this element.</p>
<p>Calling this function on a null element does nothing.</p>
<p>See also <a href="qwebelement.html#appendInside">appendInside</a>(), <a href="qwebelement.html#prependInside">prependInside</a>(), and <a href="qwebelement.html#appendOutside">appendOutside</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/previousSibling" />
<h3 class="fn"><a name="previousSibling" /><a href="qwebelement.html">QWebElement</a> QWebElement.previousSibling (<i>self</i>)</h3><p>Returns the element's previous sibling.</p>
<p>See also <a href="qwebelement.html#firstChild">firstChild</a>(), <a href="qwebelement.html#nextSibling">nextSibling</a>(), and <a href="qwebelement.html#lastChild">lastChild</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/removeAllChildren" />
<h3 class="fn"><a name="removeAllChildren" />QWebElement.removeAllChildren (<i>self</i>)</h3><p>Removes all children from this element.</p>
<p>See also <a href="qwebelement.html#removeFromDocument">removeFromDocument</a>() and <a href="qwebelement.html#takeFromDocument">takeFromDocument</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/removeAttribute" />
<h3 class="fn"><a name="removeAttribute" />QWebElement.removeAttribute (<i>self</i>, QString)</h3><p>Removes the attribute with the given <i>name</i> from this element.</p>
<p>See also <a href="qwebelement.html#attribute">attribute</a>(), <a href="qwebelement.html#setAttribute">setAttribute</a>(), and <a href="qwebelement.html#hasAttribute">hasAttribute</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/removeAttributeNS" />
<h3 class="fn"><a name="removeAttributeNS" />QWebElement.removeAttributeNS (<i>self</i>, QString, QString)</h3><p>Removes the attribute with the given <i>name</i>, in <i>namespaceUri</i>, from this element.</p>
<p>See also <a href="qwebelement.html#attributeNS">attributeNS</a>(), <a href="qwebelement.html#setAttributeNS">setAttributeNS</a>(), and <a href="qwebelement.html#hasAttributeNS">hasAttributeNS</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/removeClass" />
<h3 class="fn"><a name="removeClass" />QWebElement.removeClass (<i>self</i>, QString)</h3><p>Removes the specified class with the given <i>name</i> from the element.</p>
<a name="//apple_ref/cpp/instm/QWebElement/removeFromDocument" />
<h3 class="fn"><a name="removeFromDocument" />QWebElement.removeFromDocument (<i>self</i>)</h3><p>Removes this element from the document and makes it a null element.</p>
<p>See also <a href="qwebelement.html#removeAllChildren">removeAllChildren</a>() and <a href="qwebelement.html#takeFromDocument">takeFromDocument</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/render" />
<h3 class="fn"><a name="render" />QWebElement.render (<i>self</i>, <a href="qpainter.html">QPainter</a>)</h3><p>Render the element into <i>painter</i> .</p>
<a name="//apple_ref/cpp/instm/QWebElement/replace" />
<h3 class="fn"><a name="replace" />QWebElement.replace (<i>self</i>, QString)</h3><p>Replaces this element with the result of parsing <i>markup</i>.</p>
<p>This method will not replace the &lt;html&gt;, &lt;head&gt; or &lt;body&gt; elements.</p>
<p>See also <a href="qwebelement.html#encloseWith">encloseWith</a>().</p>
<h3 class="fn"><a name="replace-2" />QWebElement.replace (<i>self</i>, <a href="qwebelement.html">QWebElement</a>)</h3><p>Replaces this element with <i>element</i>.</p>
<p>This method will not replace the &lt;html&gt;, &lt;head&gt; or &lt;body&gt; elements.</p>
<p>See also <a href="qwebelement.html#encloseWith">encloseWith</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/setAttribute" />
<h3 class="fn"><a name="setAttribute" />QWebElement.setAttribute (<i>self</i>, QString, QString)</h3><p>Adds an attribute with the given <i>name</i> and <i>value</i>. If an attribute with the same name exists, its value is replaced by <i>value</i>.</p>
<p>See also <a href="qwebelement.html#attribute">attribute</a>(), <a href="qwebelement.html#attributeNS">attributeNS</a>(), and <a href="qwebelement.html#setAttributeNS">setAttributeNS</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/setAttributeNS" />
<h3 class="fn"><a name="setAttributeNS" />QWebElement.setAttributeNS (<i>self</i>, QString, QString, QString)</h3><p>Adds an attribute with the given <i>name</i> in <i>namespaceUri</i> with <i>value</i>. If an attribute with the same name exists, its value is replaced by <i>value</i>.</p>
<p>See also <a href="qwebelement.html#attributeNS">attributeNS</a>(), <a href="qwebelement.html#attribute">attribute</a>(), and <a href="qwebelement.html#setAttribute">setAttribute</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/setFocus" />
<h3 class="fn"><a name="setFocus" />QWebElement.setFocus (<i>self</i>)</h3><p>Gives keyboard input focus to this element</p>
<p>See also <a href="qwebelement.html#hasFocus">hasFocus</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/setInnerXml" />
<h3 class="fn"><a name="setInnerXml" />QWebElement.setInnerXml (<i>self</i>, QString)</h3><p>Replaces the contents of this element with <i>markup</i>. The string may contain HTML or XML tags, which is parsed and formatted before insertion into the document.</p>
<p><b>Note:</b> This is currently implemented for (X)HTML elements only.</p>
<p>See also <a href="qwebelement.html#toInnerXml">toInnerXml</a>(), <a href="qwebelement.html#toOuterXml">toOuterXml</a>(), and <a href="qwebelement.html#setOuterXml">setOuterXml</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/setOuterXml" />
<h3 class="fn"><a name="setOuterXml" />QWebElement.setOuterXml (<i>self</i>, QString)</h3><p>Replaces the contents of this element as well as its own tag with <i>markup</i>. The string may contain HTML or XML tags, which is parsed and formatted before insertion into the document.</p>
<p><b>Note:</b> This is currently only implemented for (X)HTML elements.</p>
<p>See also <a href="qwebelement.html#toOuterXml">toOuterXml</a>(), <a href="qwebelement.html#toInnerXml">toInnerXml</a>(), and <a href="qwebelement.html#setInnerXml">setInnerXml</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/setPlainText" />
<h3 class="fn"><a name="setPlainText" />QWebElement.setPlainText (<i>self</i>, QString)</h3><p>Replaces the existing content of this element with <i>text</i>.</p>
<p>This is equivalent to setting the HTML innerText property.</p>
<p>See also <a href="qwebelement.html#toPlainText">toPlainText</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/setStyleProperty" />
<h3 class="fn"><a name="setStyleProperty" />QWebElement.setStyleProperty (<i>self</i>, QString, QString)</h3><p>Sets the value of the inline style with the given <i>name</i> to <i>value</i>.</p>
<p>Setting a value, does not necessarily mean that it will become the applied value, due to the fact that the style property's value might have been set earlier with a higher priority in external or embedded style declarations.</p>
<p>In order to ensure that the value will be applied, you may have to append "!important" to the value.</p>
<p>See also <a href="qwebelement.html#styleProperty">styleProperty</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/styleProperty" />
<h3 class="fn"><a name="styleProperty" />QString QWebElement.styleProperty (<i>self</i>, QString, <a href="qwebelement.html#StyleResolveStrategy-enum">StyleResolveStrategy</a>)</h3><p>Returns the value of the style with the given <i>name</i> using the specified <i>strategy</i>. If a style with <i>name</i> does not exist, an empty string is returned.</p>
<p>In CSS, the cascading part depends on which CSS rule has priority and is thus applied. Generally, the last defined rule has priority. Thus, an inline style rule has priority over an embedded block style rule, which in return has priority over an external style rule.</p>
<p>If the "!important" declaration is set on one of those, the declaration receives highest priority, unless other declarations also use the "!important" declaration. Then, the last "!important" declaration takes predecence.</p>
<p>See also <a href="qwebelement.html#setStyleProperty">setStyleProperty</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/tagName" />
<h3 class="fn"><a name="tagName" />QString QWebElement.tagName (<i>self</i>)</h3><p>Returns the tag name of this element.</p>
<p>See also <a href="qwebelement.html#geometry">geometry</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/takeFromDocument" />
<h3 class="fn"><a name="takeFromDocument" /><a href="qwebelement.html">QWebElement</a> QWebElement.takeFromDocument (<i>self</i>)</h3><p>Removes this element from the document and returns a reference to it.</p>
<p>The element is still valid after removal, and can be inserted into other parts of the document.</p>
<p>See also <a href="qwebelement.html#removeAllChildren">removeAllChildren</a>() and <a href="qwebelement.html#removeFromDocument">removeFromDocument</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/toInnerXml" />
<h3 class="fn"><a name="toggleClass" />QWebElement.toggleClass (<i>self</i>, QString)</h3><p>Adds the specified class with the given <i>name</i> if it is not present. If the class is already present, it will be removed.</p>
<a name="//apple_ref/cpp/instm/QWebElement/webFrame" />
<h3 class="fn"><a name="toInnerXml" />QString QWebElement.toInnerXml (<i>self</i>)</h3><p>Returns the XML content between the element's start and end tags.</p>
<p><b>Note:</b> This is currently implemented for (X)HTML elements only.</p>
<p>See also <a href="qwebelement.html#setInnerXml">setInnerXml</a>(), <a href="qwebelement.html#setOuterXml">setOuterXml</a>(), and <a href="qwebelement.html#toOuterXml">toOuterXml</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/toOuterXml" />
<h3 class="fn"><a name="toOuterXml" />QString QWebElement.toOuterXml (<i>self</i>)</h3><p>Returns this element converted to XML, including the start and the end tags as well as its attributes.</p>
<p><b>Note:</b> This is currently implemented for (X)HTML elements only.</p>
<p>See also <a href="qwebelement.html#setOuterXml">setOuterXml</a>(), <a href="qwebelement.html#setInnerXml">setInnerXml</a>(), and <a href="qwebelement.html#toInnerXml">toInnerXml</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/toPlainText" />
<h3 class="fn"><a name="toPlainText" />QString QWebElement.toPlainText (<i>self</i>)</h3><p>Returns the text between the start and the end tag of this element.</p>
<p>This is equivalent to reading the HTML innerText property.</p>
<p>See also <a href="qwebelement.html#setPlainText">setPlainText</a>().</p>
<a name="//apple_ref/cpp/instm/QWebElement/toggleClass" />
<h3 class="fn"><a name="webFrame" /><a href="qwebframe.html">QWebFrame</a> QWebElement.webFrame (<i>self</i>)</h3><p>Returns the web frame which this element is a part of. If the element is a null element, null is returned.</p>
<a name="//apple_ref/cpp/instm/QWebElement/operator!=" />
<h3 class="fn"><a name="__eq__" />bool QWebElement.__eq__ (<i>self</i>, <a href="qwebelement.html">QWebElement</a>)</h3><h3 class="fn"><a name="__ne__" />bool QWebElement.__ne__ (<i>self</i>, <a href="qwebelement.html">QWebElement</a>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>