Recently, I’m doing web scraping using the awesome library HtmlAgilityPack. With HtmlAgilityPack, I use XPath to match the required object/tag in the DOM. While working with XPath, I’m wondering is there anyway to test XPath in Google Chrome browser with highlighting the matched tag in browser. The answer is YES. We can test XPath in Google Chrome.
Here is the steps to do so:
- Open Developer Tools
- Select Console tab.
$xtoken. For example,
$x("/html/body")will select the
A picture worth a thousand words. :)