xpath-helper
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "xpath-helper", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A simple and chainnable API to build complicated XPath queries without the hassle.", | ||
"keywords": ["xpath", "helper", "selenium", "test", "selector", "scraping"], | ||
"main": "dist/cjs/xpath-helper.js", | ||
@@ -6,0 +7,0 @@ "module": "dist/mjs/xpath-helper.js", |
@@ -26,2 +26,11 @@ <p align="center"> | ||
``` | ||
It can be also be imported as a JavaScript module. | ||
```javascript | ||
<script type="module" > | ||
import { xh, filter} from 'https://unpkg.com/xpath-helper@latest/dist/mjs/xpath-helper.js'; | ||
console.log( | ||
xh.getElementByTag('body').getElementByTag('h1', filter.valueEquals('hello')).toString() | ||
); | ||
</script> | ||
``` | ||
## Quick-start | ||
@@ -56,3 +65,2 @@ You can chain method call on the different [XPath axes](https://jrebecchi.github.io/xpath-helper/xpath-axes.html) and easily add filters. | ||
``` | ||
getDescendantOrSelf | ||
## Chaining | ||
@@ -64,3 +72,3 @@ | ||
For each axis, xpath-helper provides 3 methods, like for instance `getElement(filter)`, `getElementByTag(tag, filter)`, `get_child_by_svg_tag(svgTag, filter)` for the `descendant` axis aliased as `element`. | ||
For each axis, xpath-helper provides 3 methods, like for instance `getElement(filter)`, `getElementByTag(tag, filter)`, `getElementBySVGTag(svgTag, filter)` for the `descendant` axis aliased as `element`. | ||
@@ -67,0 +75,0 @@ ***The complete filter API can be found [here](https://jrebecchi.github.io/xpath-helper/javascript/api.html#xpathhelper-xh).*** |
131145
197