Hacker News new | comments | ask | show | jobs | submit login
Show HN: CSS selector generator for shortest, unique, robust selectors (github.com)
29 points by medv 11 months ago | hide | past | web | favorite | 3 comments

There's something a bit like this I've been using for years to get selectors with which to scrape data from page, it's called Selector Gadget: http://selectorgadget.com/ .. you click on elements you want, elements you don't want, and it works out what CSS selector matches best.

Wow, reminds me of the same thing I built 7 years ago :) https://github.com/cheeaun/getSelector.js

disclaimer: I haven't used or seen something like this before:

What does the workflow for this look like? Would you add this to your project for development purposes and use it to write selectors that are more efficient than you'd otherwise write. Or would it be used in tandem with protractor or a similar integration testing tool to make picking selectors for writing tests easier?

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact