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

房东的猫 提交于 2019-12-18 09:37:54

问题


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?


回答1:


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.




回答2:


Firepath is a very nice extension to Firebug which can help with CSS and XPath references.




回答3:


Uncheck the Option of "Generate absolute Xpath":



来源:https://stackoverflow.com/questions/24212548/how-to-get-the-absolute-xpath-for-an-element-within-firebug

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!