contains

returns elements that are containing the specified text.

Arguments

Source


def contains(self, text):
    ret = pyNodeList()
    for node in self:
        if node.text().find(text) != -1:
            ret.append(node)
    if len(ret) == 1: return ret[0]
    else: return ret