Xpath Helper的安装和使用
为了帮助大家快速掌握 Xpath 表达式的使用,这里给大家推荐一款 Xpath 表达式匹配助软件,它就是 Xpath Helper。

图 1:Xpath Helper助手
点击扩展程序入口,进入管理扩展程序界面,如下图所示:

图 2:Chrome浏览器插件管理界面
您也可以通过以下步骤进入上述管理界面:浏览器设置 -> 更多工具 ->扩展程序 ->开发者模式。注意:此时右上角的开发者模式应处于开启状态。

如果您没有谷歌应用商店账号,您也可以在网上搜索免费的下载资源。为了节省您的时间,下面提供了资源下载链接:

Xpath Helper介绍
Xpath Helper 是一款谷歌应用商店推出的免费工具,因此您需要在谷歌商店进行下载。下载完毕后,谷歌浏览器会将其作为插件自动安装在扩展程序中,如下所示:
图 1:Xpath Helper助手

图 2:Chrome浏览器插件管理界面
Xpath Helper使用
安装完毕后,在需要匹配数据的页面处,使用快捷键打开助手工具(快捷键:ctrl+shift+x),使用示意图如下:
图 3:Xpath使用示意图(点击看高清图)
将鼠标悬停在需要选取数据的文本上,并按下shift
按键就会自动出现 Xpath 表达式,然后再根据您自己的需求对表达式稍微修改即可。如果您没有谷歌应用商店账号,您也可以在网上搜索免费的下载资源。为了节省您的时间,下面提供了资源下载链接:
云盘链接:https://pan.baidu.com/s/18LcxOCLqALlob33UybTATA 提取码:eo1m下载解压后,将文件夹直接拖入 Chrome 扩展程序即可完成安装。
浏览器Xpath匹配助手
谷歌开发者调试工具也内置了 Xpath 表达式匹配功能,首先打开调试工具,在下方的调试工作区内使用快捷键ctrl+F
打开 Xpath 匹配功能,如下图所示:
图 4:Chrome调试工具Xpath使用(点击看高清图)