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

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:

主站蜘蛛池模板: 乐平市| 泸州市| 泸州市| 青岛市| 喀什市| 柞水县| 师宗县| 英山县| 通海县| 巫山县| 明光市| 金昌市| 彭泽县| 西畴县| 叙永县| 贵溪市| 福建省| 海淀区| 鄂温| 贞丰县| 德庆县| 新蔡县| 抚顺县| 清苑县| 秦安县| 泸定县| 汉川市| 永和县| 通江县| 望奎县| 日土县| 清远市| 清远市| 石楼县| 项城市| 资中县| 财经| 林州市| 泽库县| 北安市| 四会市|