Is there a way to get the XPath in Google Chrome?
You can use $x
in the Chrome javascript console. No extensions needed.
ex: $x("//img")
Also the search box in the web inspector will accept xpath
All above answers are correct here is another way with screenshot too.
From Chrome :
- Right click "inspect" on the item you are trying to find the xpath
- Right click on the highlighted area on the console.
- Go to Copy xpath