有没有办法在 Google Chrome 中获取 XPath? [英] Is there a way to get the XPath in Google Chrome?
本文介绍了有没有办法在 Google Chrome 中获取 XPath?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个要与 YQL 一起使用的网页.但我需要特定项目的 XPath.我可以在 Google Chrome 的调试工具区域中看到它,但我看不到复制该 XPath 的方法.
I have a webpage I want to use with YQL. But I need the XPath of a specific item. I can see it in the debug tools area for Google Chrome but I don't see a way to copy that XPath.
有没有办法复制完整的 XPath?
Is there a way to copy a full XPath?
推荐答案
您可以在 Chrome javascript 控制台中使用 $x
.无需扩展.
You can use $x
in the Chrome javascript console. No extensions needed.
例如:$x("//img")
Web 检查器中的搜索框也将接受 xpath
Also the search box in the web inspector will accept xpath
这篇关于有没有办法在 Google Chrome 中获取 XPath?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文