1. 程式人生 > >Mozilla Firefox安裝Firepath Firebug找xpath最新可用的方法附老版本Firefox下載連結

Mozilla Firefox安裝Firepath Firebug找xpath最新可用的方法附老版本Firefox下載連結

Mozilla Firefox

這個是有版本要求的,可以從Firepath安裝的時候看到,要求Firefox版本3.5-6.0  所以呢,你要裝一個老版本的Firefox,這裡給你準備好了

With FirePath you can:
* Edit XPath expressions, CSS3 selectors and JQuery selectors (Sizzle selector engine) with auto completion for XPath (using TAB or up and down arrows).
* Evaluate the expression/selector on any HTML or XML documents.
* Display the result of evaluations in a Firebug-like DOM tree.
* Highlight the results directly on the document displayed by Firefox (works only with HTML documents).
* Generate an XPath expression or a CSS selector for an element by right clicking on it and selecting "Inspect in FirePath" in the context menu.
* Define the evaluation context (parent) of an expression/selector.
* Choose the document in which to evaluate the expression/selector (only applicable for HTML documents with frames or iframes).

FirePath 0.9.7 requires Firefox 3.5 to 6.0 and Firebug 1.4 to 1.8.*
Note that the XPath auto completion does not work with Firebug 1.6 and higher

Firebug

Firepath

安裝

使用教程:

通過firebug+firepath可以得到元素的xpath和css path。

1. 得到xpath

1.1 開啟firebug視窗
1.2 然後選擇要檢視xpath的頁面元素,xpath就會顯示在firebug視窗,如下圖 

下面給你們演示一下我的安裝成功後可使用圖片

以 www.baidu.com為例

點選一下,然後點選一下要找的元素,即可看到定位,然後FirePath隨著也出現了。

這種方法可以得到元素的相對xpath,如果想得到元素的絕對xpath,在FirePath旁邊的小三角選擇Generate Absolute xpath.  

2. 得到css path

方法和得到xpath一樣,選擇css就行,如下圖所示 

ok,基本介紹完了,看完請點個贊呀