I have a webpage I want to use with YQL. But I need the XPath of a specific item. I can see it in the debug tools area for Google Chrome but I don\'t see a way to copy tha
xpathOnClick has what you are looking for: https://chrome.google.com/extensions/detail/ikbfbhbdjpjnalaooidkdbgjknhghhbo
Read the comments though, it actually takes three clicks to get the xpath.
For Chrome, for instance:
a. To do so, by opening the 'Elements' panel of the browser, press CTRL+F, paste the XPath.
b. Make changes as describes in the following example.
Absolute xpath = //*[@id="app"]/div[1]/header/nav/div[2]/ul/li[2]/div/button
Related xpath = //div//nav/div[2]/ul/li[2]/div/button
When you make changes:
You can try using Chrome Web Extension TruePath which dynamically generates the relative XPath on right click on the web page and display all the XPath as menu items.
No extension needed in chrome now. Right click on any element you want xpath for and click on "Inspect Element" and then again inside the Inspector, right click on element and click on "Copy Xpath".
XPath Helper extension does what you need: https://chrome.google.com/webstore/detail/hgimnogjllphhhkhlmebbmlgjoejdpjl
As of the latest update for chrome you can now click any element in the element inspector and copy the XPath to clipboard.