3 ms·
What / how do you use it? I've only ever used xpath for scraping, and I don't know how it can be useful outside of scraping.
by Buttons840 3y ago
What / how do you use it? I've only ever used xpath for scraping, and I don't know how it can be useful outside of scraping.
- diarrhea 3y agoEnd to end testing comes to mind, for UI testing.
- zelphirkalt 3y agoI think you can use it in the browser's inspector.
- palsecam 3y agoYes, you can use `$x("//a/path")`, with (at least) Chrome & Firefox. See https://devhints.io/xpath https://devhints.io/xpath & https://devtoolstips.org/tips/en/evaluate-xpath/ https://devtoolstips.org/tips/en/evaluate-xpath/, and in this thread: https://news.ycombinator.com/item?id=36755041 https://news.ycombinator.com/item?id=36755041
- dusanh 3y agoAnd you can do the same for CSS selectors with $$('foo')!