How can I get the xpath of an element in developer tools as firebug is not supported in latest ff

learning

(Mikky26490) #1

How can I get the xpath of an element in developer tools as firebug is not supported in latest ff.
Earlier I was using firebug for this purpose and now I am not able to use that as it is not supporting latest firefox.


(Nicolas Chevobbe) #2

Hello,

You can copy the XPath of an element in the inspector by right clicking on it and choosing Copy → XPath:


(Pnjagadeesh) #3

Xpath is not always simple as mentioned. Most of the times we deal with custom xpath the we build ourself. Earlier we had FirePath where we could test whether it is pointing to the right element. But now there is no way in the inspector where I can enter xpath and test it. Sad that Mozilla removed Firebug and Firepath. Firefox lost its usefulness here.

It would have been better if there is a way I can enter xpath like firepath.


(Nicolas Chevobbe) #4

I don’t see anything on FirePath repo about a current work to release a new webextension version.
But I found this which might offer what you need : https://addons.mozilla.org/en-US/firefox/addon/try-xpath/?src=search

Also there’s https://github.com/Anupama-H/ChroPath , which even if not working at the moment, shouldn’t be hard to adapt to Firefox.


(Mironf) #5

Not working with FF58.


(Uzair It1990) #6

@mikky26490
You can use console on Firefox dev edition and use commands from https://developers.google.com/web/tools/chrome-devtools/console/command-line-reference

Example, for xpath you need to use $x(path). By passing your path and pressing enter, it will detect if the element is present on your screen