Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

It is a flexible and powerful language for querying xml or (x) html elements of a document and xslt transformations over the DOM, which is a W3C standard .

What is XPath in ZennoPoster for?

Using XPath, you can implement a more versatile and robust data search algorithm in comparison with regular expressions. This query language allows you to significantly simplify the logic of parsers and thereby speed up their development.

...

ZennoPoster has a built-in X\Json Path Tester with which you can test the composed expression.

You can also compose and test an XPath expression in the DevTools window: open the DevTools window, press ctrl + f to call the search bar and enter the XPath expression into it:

...

Expression

Description

(table/tbody/tr)[last()]

last <tr> row from all tables

(//h1|//h2)[contains(text(), 'Text')]

a first or second level heading that contains "Text"

a[//tr/@data-id=@data-id]

all links whose data-id attribute matches the same attribute for a table row

...