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
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