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?
For parsing sites (action Parse data)
To find and interact with elements on a web page
Can be used in the Action Designer
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 |
Useful links
...