← Back to context

Comment by yusaydat

24 days ago

Xpath is still used for e2e tests and things like scraping. Especially when there aren't better selectors available.

The point is that you don't need the very latest version. The 20 years old version is enough.

  • XPath 1.0 is a pain to write queries for. XPath 2.0 adds features that make it easier to write queries. XPath 3.1 adds support for maps, arrays, and JSON.

    And the default Python XPath support is severely limited, not even a full 1.0 implementation. You can't use the Python XPath support to do things like `element[contains(@attribute, 'value')]` so you need to include an external library to implement XPath.