Table Of Contents

Previous topic

QWebHistoryItem

Next topic

QWebElement

QWebElementCollection

Inheritance diagram of QWebElementCollection

Note

This class was introduced in Qt 4.6

Synopsis

Functions

Detailed Description

The 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) {
    ...
}
class PySide.QtWebKit.QWebElementCollection
class PySide.QtWebKit.QWebElementCollection(contextElement, query)
class PySide.QtWebKit.QWebElementCollection(arg__1)
Parameters:

Constructs an empty collection.

Constructs a collection of elements from the list of child elements of contextElement that match the specified CSS selector query .

Constructs a copy of other .

PySide.QtWebKit.QWebElementCollection.__getitem__()
PySide.QtWebKit.QWebElementCollection.__len__()
PySide.QtWebKit.QWebElementCollection.append(collection)
Parameters:collectionPySide.QtWebKit.QWebElementCollection

Extends the collection by appending all items of other .

The resulting collection may include duplicate elements.

See also

PySide.QtWebKit.QWebElementCollection.operator+=()

PySide.QtWebKit.QWebElementCollection.at(i)
Parameters:iPySide.QtCore.int
Return type:PySide.QtWebKit.QWebElement

Returns the element at index position i in the collection.

PySide.QtWebKit.QWebElementCollection.count()
Return type:PySide.QtCore.int

Returns the number of elements in the collection.

PySide.QtWebKit.QWebElementCollection.first()
Return type:PySide.QtWebKit.QWebElement

Returns the first element in the collection.

PySide.QtWebKit.QWebElementCollection.last()
Return type:PySide.QtWebKit.QWebElement

Returns the last element in the collection.

PySide.QtWebKit.QWebElementCollection.__add__(other)
Parameters:otherPySide.QtWebKit.QWebElementCollection
Return type: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.

See also

PySide.QtWebKit.QWebElementCollection.operator+=()

PySide.QtWebKit.QWebElementCollection.__iadd__(other)
Parameters:otherPySide.QtWebKit.QWebElementCollection
Return type:PySide.QtWebKit.QWebElementCollection

Appends the items of the other list to this list and returns a reference to this list.

See also

PySide.QtWebKit.QWebElementCollection.operator+() PySide.QtWebKit.QWebElementCollection.append()

PySide.QtWebKit.QWebElementCollection.operator[](i)
Parameters:iPySide.QtCore.int
Return type:PySide.QtWebKit.QWebElement

Returns the element at the specified position in the collection.

PySide.QtWebKit.QWebElementCollection.toList()
Return type:

Returns a QList object with the elements contained in this collection.