浏览器开发模式下xpath复制

对一个标签的xpath语法复制功能,Chrome做得比FireFox要好。

以百度首页为例:

<link rel="stylesheet" href="https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/soutu/css/soutu.css" type="text/css" data-for="result">

#从Firefox复制过来xpath(使用的是绝对路径定位)
/html/body/div[2]/div[2]/div[5]/link


#从Chrome复制过来xpath(使用的是元素属性定位)
//*[@id="head_wrapper"]/link

※360浏览器,Opera也跟Chrome一致。

猜你喜欢

转载自blog.csdn.net/sisqzy86/article/details/84201637