问题
I've made the move to Chrome, but one of the most annoying features with 'Firebug lite' is that it doesn't allow you to copy the CSS path of objects.
To see what I mean, in Firefox, go to google.com and inspect the logo with Firebug. Right click on the 'hplogo' div and pick 'Copy CSS path'. You'll get something like:
html body#gsr div#main span#body.ctr-p center div#lga div div#hplogo
This is an incredibly useful feature that I can't find on Chrome, it appears you can only copy the Xpath.
Is there a way to use this type of functionality in Chrome?
Thanks
回答1:
There is no native way to get this information in Chrome. You can do a bunch of hacks, using jQuery and bookmarks as show here: http://www.edmondscommerce.co.uk/chrome/tip-copy-css-selector-in-chrome/ as well as here: http://www.selectorgadget.com/
However, you may find this extension to be closer to what you want, and a little easier to use: https://chrome.google.com/webstore/detail/lbghbpofdlcecfbpjgmffnkieenjkboi It will pull the XPath as well as the CSS Path, and allow you to easily copy the text.
回答2:
In chrome you can right click on an element in the elements explorer view and select copy CSS path or copy Xpath.
来源:https://stackoverflow.com/questions/11443437/chrome-equivalent-of-firefox-firebug-css-select-path