Tool to generate XPath


Hi, I'm making a spider to XPath capture some data from the web.

However, the creation of xpath is a little laborious. Does anyone know any way to train XPath? Example; I click 5 times on a link and some tool generates the xpath.

Any tip is welcome.



I compiled the answers found here:

"Chrome Dev Tools"

When using "Chrome Dev Tools" (You can access by right clicking on some element and ask to "inspect element") you can right click on the element, then "Copy XPath".

Add-on for Chrome.

Javascript console

You can also use $x in Chrome's javascript console.

ex: $x("//img")


I didn't get to test it, but this tool apparently seems to be what you want.


Scroll to Top