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

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.

主站蜘蛛池模板: 巴彦县| 卢湾区| 台中市| 孟州市| 织金县| 佛山市| 星座| 铁力市| 永修县| 灯塔市| 仙桃市| 盐亭县| 武鸣县| 惠东县| 尖扎县| 丹凤县| 应用必备| 于田县| 铜鼓县| 宝坻区| 玉山县| 阿合奇县| 西吉县| 朝阳市| 汉寿县| 安顺市| 通化市| 莲花县| 江陵县| 巴塘县| 镶黄旗| 分宜县| 公安县| 博爱县| 遵义县| 江陵县| 宁阳县| 济源市| 丽江市| 宽甸| 黑水县|