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

Introduction to XPath (XML Path)

An XPath represents a path, and when evaluated on a tree, the result is the node set at the end of any path in the tree. HTML, the formatting language used to configure the data in web pages, aims to create a visually appealing interface. 

In particular, XML Path Language (XPath) provides powerful syntax for handling specific elements of an XML document and, to the same extent, HTML web pages, in a simple way. XPath is defined as a DOM by the World Wide Web Consortium.

There are two ways to use XPath:

  • To identify a single item in the document tree
  • To address multiple instances of the same item

The main weakness of XPath is its lack of flexibility. Each XPath expression is strictly related to the structure of the web page you are defining.

However, this limitation has been partially reduced since relative road expressions have been added in recent releases. In general, even small changes to the structure of a web page can cause an XPath expression that was defined in an earlier version of the page to not work correctly. In the following screenshot, you can see one XPath rule and its response:

主站蜘蛛池模板: 策勒县| 沙河市| 常德市| 镇原县| 安龙县| 鹤壁市| 古田县| 枣强县| 锡林浩特市| 凉城县| 綦江县| 喀喇沁旗| 尉氏县| 娱乐| 广昌县| 申扎县| 应城市| 民和| 栾川县| 桃江县| 贵定县| 宁化县| 南溪县| 玛沁县| 德钦县| 株洲市| 平昌县| 大理市| 马山县| 九龙坡区| 吴堡县| 商洛市| 名山县| 云梦县| 葫芦岛市| 高尔夫| 孟村| 凤凰县| 宣化县| 东至县| 崇阳县|