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

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.

主站蜘蛛池模板: 定州市| 古交市| 德阳市| 玛多县| 京山县| 无锡市| 阳信县| 郎溪县| 河池市| 仁化县| 深圳市| 突泉县| 青龙| 昭平县| 塔城市| 嘉义市| 上饶市| 郁南县| 内乡县| 普格县| 康乐县| 安远县| 靖边县| 三明市| 原平市| 湖州市| 东城区| 辽阳县| 邵阳县| 长葛市| 无锡市| 疏勒县| 丹江口市| 桐庐县| 克拉玛依市| 阿勒泰市| 西安市| 当雄县| 鲜城| 开鲁县| 历史|