Traversing ---------- .. >>> from pyquery import PyQuery as pq Some jQuery traversal methods are supported. Here are a few examples. You can filter the selection list using a string selector:: >>> d = pq('

') >>> d('p').filter('.hello') [] It is possible to select a single element with eq:: >>> d('p').eq(0) [] You can find nested elements:: >>> d('p').find('a') [, ] >>> d('p').eq(1).find('a') [] Breaking out of a level of traversal is also supported using end:: >>> d('p').find('a').end() [, ] >>> d('p').eq(0).end() [, ] >>> d('p').filter(lambda i: i == 1).end() [, ] If you want to select a dotted id you need to escape the dot:: >>> d = pq('

') >>> d(r'#hello\.you') []