3

I am building a web scraper using Firefox with Selenium WebDriver, and I would like to use XPath expressions that exist only in XPath 2 and XPath 3.

Which version of XPath does Firefox support?

If it is XPath 1.0, is there any way to make Firefox support later versions?


Note: The current version of Firefox as of writing is 47.0.

P A N
  • 1,417
  • 4
  • 23
  • 42

1 Answers1

2

Which version of XPath does Firefox support?

Firefox currently supports XPath 1.0.

There are no plans to support Xpath 2.0.

See What browsers support Xpath 2.0? for some workarounds.

Support for XPath varies widely; it's supported reasonably well in Firefox (although there are no plans to improve support further), while other browsers implement it to a lesser extent if at all.

Source XPath

There is an open (since 2007) bug report to add support for XPath 2.0:

As Xpath 2.0 and Xslt 2.0 is a w3c recommendation, it would be a good idea to implement it into the engine.

Source Bug 396966 - Xpath 2.0


Further Reading

DavidPostill
  • 153,128
  • 77
  • 353
  • 394
  • [Firefox bug for XPath 3.1](https://bugzilla.mozilla.org/show_bug.cgi?id=1556141): "The effort required to implement newer versions of XPath and XSLT is pretty big and hard to justify given that they're little used technologies on the web. I also don't think any of the other browsers have signaled that they're interested in shipping support for newer versions." – robertspierre Aug 27 '23 at 21:10