注意
该类在 Qt4.6 引入
PySide.QtWebKit.QWebElementCollection class represents a collection of web elements.
Elements in a document can be selected using QWebElement.findAll() or using the PySide.QtWebKit.QWebElement constructor. The collection is composed by choosing all elements in the document that match a specified CSS selector expression.
The number of selected elements is provided through the PySide.QtWebKit.QWebElementCollection.count() property. Individual elements can be retrieved by index using PySide.QtWebKit.QWebElementCollection.at() .
It is also possible to iterate through all elements in the collection using Qt's foreach macro:
QWebElementCollection collection = document.findAll("p");
foreach (QWebElement paraElement, collection) {
...
}
| 参数: |
|
|---|
Constructs an empty collection.
Constructs a collection of elements from the list of child elements of contextElement that match the specified CSS selector query .
构造副本为 other .
| 参数: | collection – PySide.QtWebKit.QWebElementCollection |
|---|
Extends the collection by appending all items of other .
The resulting collection may include duplicate elements.
另请参阅
PySide.QtWebKit.QWebElementCollection.operator+=()
| 参数: | i – PySide.QtCore.int |
|---|---|
| 返回类型: | PySide.QtWebKit.QWebElement |
Returns the element at index position i in the collection.
| 返回类型: | PySide.QtCore.int |
|---|
返回集合中的元素数。
| 返回类型: | PySide.QtWebKit.QWebElement |
|---|
Returns the first element in the collection.
另请参阅
PySide.QtWebKit.QWebElementCollection.last() PySide.QtWebKit.QWebElementCollection.operator[]() PySide.QtWebKit.QWebElementCollection.at() PySide.QtWebKit.QWebElementCollection.count()
| 返回类型: | PySide.QtWebKit.QWebElement |
|---|
Returns the last element in the collection.
另请参阅
PySide.QtWebKit.QWebElementCollection.first() PySide.QtWebKit.QWebElementCollection.operator[]() PySide.QtWebKit.QWebElementCollection.at() PySide.QtWebKit.QWebElementCollection.count()
| 参数: | other – PySide.QtWebKit.QWebElementCollection |
|---|---|
| 返回类型: | PySide.QtWebKit.QWebElementCollection |
Returns a collection that contains all the elements of this collection followed by all the elements in the other collection. Duplicates may occur in the result.
另请参阅
PySide.QtWebKit.QWebElementCollection.operator+=()
| 参数: | other – PySide.QtWebKit.QWebElementCollection |
|---|---|
| 返回类型: | PySide.QtWebKit.QWebElementCollection |
Appends the items of the other list to this list and returns a reference to this list.
另请参阅
PySide.QtWebKit.QWebElementCollection.operator+() PySide.QtWebKit.QWebElementCollection.append()
| 参数: | i – PySide.QtCore.int |
|---|---|
| 返回类型: | PySide.QtWebKit.QWebElement |
Returns the element at the specified position in the collection.
| 返回类型: |
|---|
返回 QList object with the elements contained in this collection.