Source
def header(self):
ret = pyNodeList()
h = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']
for node in self:
if node.name() in h:
ret.append(node)
if len(ret) == 1: return ret[0]
else return ret
returns header elements.
def header(self):
ret = pyNodeList()
h = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']
for node in self:
if node.name() in h:
ret.append(node)
if len(ret) == 1: return ret[0]
else return ret