星空Blog - XPath
type: channel
link: https://www.xk0.cn/tag/XPath/
items: XPath提取的用法

XPath提取的用法
type: item
date: 2020-04-16T15:16:00+08:00
description: XPath常用的用法下面是演示代码<?xml version="1.0" encoding="UTF-8"?> Harry Potter 29.99 Learning XML 39.95 选择整个标签选择多个title标签推荐下面两种方法：/bookstore/book/title //*[@lang="eng"] 提取文字提取 Harry Potter/bookstore/book/title/text()[1] /bookstore/book/text()[1] /bookstore/book/title/text() /bookstore/book/text() 选择文字等于keyword的标签/bookstore/book/title[.="{keyword}"] 相关参考菜鸟教程