Hacker News new | ask | show | jobs
by bartkappenburg 3710 days ago
OT perhaps: I'm still looking for a solution that has a graphical UI that allows users to point and click an element on their page and returns the corresponding CSS-selector. SelectorGadget does this as a chrome-extension but I'm looking for something that works without an extension.
3 comments

Chrome Developer tools. Inspect an element to get it in the elements tab. Right click the element's HTML, copy -> copy selector.

#hnmain > tbody > tr:nth-child(3) > td > table > tbody > tr.athing > td.default

Explain that to a small business owner (our customers) using IE of Safari. ;-)
Why not make a screencast?
AFAIK, Selectorgadget's chrome extension is just a wrapper around the bookmarklet. It's pure JS, doesn't use any sort of elevated privileges, and is MIT licensed so you can include the core engine in your own projects.
Flutter Selector(https://flutter.social/bookmarklet) seems to do exactly what you want.