Hacker News new | ask | show | jobs
by malditojavi 3903 days ago
I don't get it - I do this in Chrome tools > magnifying glass > right click > Copy CSS path. What does it solve this ?
2 comments

The purpose of this bookmarklet is to provide a streamlined method of getting the selector without having to go into the source or use chrome tools.

There is also the problem of using ids. For example in Flutter I may want to auto tweet out the top post in a list of posts on a blog. If the posts have individual ids, and the CSS selector includes them, every time Flutter tries to scrape new content it will get the same post. I want the unique selector for the page element. i.e. the first post in the list.

This is built in to FireFox too. Right click element, "Inspect Element", Right click element which is now scrolled in view and highlighted in the tools, "Copy Unique Selector".

I guess having it directly on right click or in view would be useful sometimes.