Is there a way to get the xpath in google chrome?

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.

Is there a way to copy a full xpath or an extension to do it?


You can use $x in the Chrome javascript console. No extensions needed.

ex: $x("//img")

Also the search box in the web inspector will accept xpath


右键点击节点=>“复制XPath”


All above answers are correct here is another way with screenshot too.

From Chrome :

  • Right click "inspect" on the item you are trying to find the xpath
  • Right click on the highlighted area on the console.
  • Go to Copy xpath
  • 在这里输入图像描述

    链接地址: http://www.djcxy.com/p/16188.html

    上一篇: 谷歌铬扩展:: console.log()从后台页面?

    下一篇: 有没有办法在google chrome中获取xpath?