Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
751 views
in Technique[技术] by (71.8m points)

html - How to get the absolute XPath for an element within Firebug?

I used to see the absolute XPath for an element within Firebug. E.g. something like this:

html/body/div[2]/table/tbody/tr/td

When I select a certain element in a table using Firebug, then hover around the highlighted code inside the HTML panel I can't see the XPath anymore.

How to get Firebug to display the XPath again as a tooltip or any other way?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The tooltips for elements within the HTML panel were removed in Firebug 2.0, because there were repeated requests saying these tooltips were rather annoying than helpful.

If you need the XPath of an element, you can right-click it and choose Copy XPath from the context menu to copy the absolute XPath of the element to the clipboard.

For elements with and id attribute there's also a new option in Firebug 2.0 to copy a short XPath called Copy Minimal XPath.

Copy XPath and Copy Minimal XPath option for element


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...