hierarchy selectors not working for 'not_'

Issue #7 resolved
Elijah Rutschman
created an issue



html = """<html> <body> <ul> <li>C</li> <li>D</li> </ul> <div> <ul> <li>E</li> <li>F</li> </ul> </div> </body> </html>"""

import pyquery q = pyquery.PyQuery(html) ul = q.find('ul').not_('div > ul')

print ul


should be printing:



Comments (3)

  1. Elijah Rutschman reporter
    print ul.eq(1).is_('div > ul')
    # False
    # should print:
    # True

    The scope of this bug is larger than the not_ method; the selected elements' context is lost, so that any further filtering on a PyQuery object cannot be done using selectors that reference parent elements.

  2. Log in to comment