官术网_书友最值得收藏!

Inspecting pages and elements with Mozilla Firefox

The newer versions of Mozilla Firefox provide built-in ways to inspect the page and elements. To inspect an element from the page, move the mouse over the desired element and right-click to open the pop-up menu. Select the Inspect Element option, as shown in the following screenshot:

This will display the Inspector tab with the HTML code in a tree format with the selected element highlighted, as shown in the following screenshot:

Using Inspector, we can also validate the XPath or CSS Selectors using the search box shown in the Inspector section. Just enter the XPath or CSS Selector and Inspector will highlight the elements that match the expression, as shown in the following screenshot:

The Developer tools provide various other debugging features. It also generates XPath and CSS selectors for elements. For this, select the desired element in the tree, right-click, and select the Copy > XPath or Copy > CSS Path option from the pop-up menu, as shown in the following screenshot:  

This will paste the suggested XPath or CSS selector value to the clipboard to be used later with the findElement() method.

主站蜘蛛池模板: 江口县| 会同县| 蓝田县| 易门县| 马公市| 滕州市| 香港 | 渝北区| 特克斯县| 泌阳县| 济南市| 道孚县| 台东市| 怀柔区| 娄烦县| 鲁山县| 商河县| 随州市| 吉安市| 阜阳市| 东光县| 台北市| 铜梁县| 淄博市| 太保市| 侯马市| 冀州市| 博客| 长岭县| 建始县| 阜新| 新密市| 阳高县| 什邡市| 徐水县| 江永县| 富宁县| 霍林郭勒市| 温宿县| 泰宁县| 拜泉县|