Find XPath to any element quickly with FireBug

Edit: I found out that right clicking on a tag in Firebug’s HTML tab and clicking on “Copy XPath” is a much quicker method.

I just discovered a way to quickly find the XPath to any element on a webpage with Firebug. This will help me a lot in the development of my Greasemonkey script HorariGlobal.

  • Right-click on element.
  • Click on “Inspect element” entry.
  • Go to HTML tab in the Firebug frame then the style tab on the right.
  • Right-click on empty space in that frame, select “Edit element style”
  • Hover mouse over the text item “element.style {” that has just appeared.

I imagine there is a tool somewhere out there that will do this in one step, but this will do me for now.

About johnny

I'm a French-born Scot living in Spain. Computers have interested me since I can remember and conveniently I'm now studying a computer science degree. This here is my BLOGOSPHERE OUTLET where I post solutions to problems I've had in the office or any other arbitrary project, hopefully for future reference AND TO BE PICKED UP BY THE BLOGOSPHERE. (not really I hate the 'blogosphere').
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

One Response to Find XPath to any element quickly with FireBug

  1. Dimitris says:

    Right now you can just right click on e.g. a DIV and do “Copy XPath” directly.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>