Skip to content

Find by xpath #1511

@rulrok

Description

@rulrok

What problem does this feature solve?

Create a xfind method which allows for xpath selectors as an alternative to css selectors of find method.

What does the proposed API look like?

Currently: wrapper.find('a#abc[for="xyz"]')
Proposed: wrapper.xfind('//a[@id="abc"][@for="xyz"]')

Currently: wrapper.find('ul > li')
Proposed: wrapper.xfind('//ul/li')

Currently: wrapper.find('h1:not([id])')
Proposed: wrapper.xfind('//h1[not(@id)]')

Other examples:

Arithmetic
xfind('//product[@price > 2.50]')

Or logic
xfind('//a[@name or @href]')

XPath examples taken from here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions