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

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:

主站蜘蛛池模板: 武义县| 侯马市| 逊克县| 襄城县| 鄄城县| 金门县| 阜平县| 若尔盖县| 商城县| 太仆寺旗| 天祝| 珠海市| 文登市| 如皋市| 慈利县| 诸城市| 香港 | 济阳县| 宁远县| 河北区| 鹰潭市| 社会| 象山县| 布拖县| 巍山| 乐平市| 裕民县| 通化县| 上饶县| 新泰市| 神农架林区| 桂林市| 万州区| 永登县| 香格里拉县| 察哈| 临汾市| 雅安市| 广南县| 项城市| 海安县|