News for hackers. Stuff that matters.
Re:Introducing SelectorGadget: point and click minimal CSS s... by tectonic on Thursday February 26, 2009 @03:33PM (#496366)
Please tell me when you find sites that it doesn't work on, there are so many edge cases.
Re:Introducing SelectorGadget: point and click minimal CSS s... by chrisconley on Thursday February 26, 2009 @05:50PM (#496565)
This is awesome. It would've have been super useful building our mobile interface to Philadelphia's regional rail schedules where we scraped SEPTA's site for data. http://www.septa.org/service/sched/r2s_wk.html is an example of the markup we had to deal with.

I think I'll have to go back and crosscheck your selectors with what I came up with to see if we can't improve anything. Thanks!

Re:Introducing SelectorGadget: point and click minimal CSS s... by thaumaturgy on Friday February 27, 2009 @04:16AM (#497046)
Oh sweet merciful Bob that has got to be some of the nastiest markup I've ever seen.
Re:Introducing SelectorGadget: point and click minimal CSS s... by matt1 on Thursday February 26, 2009 @07:34PM (#496663)
Whoa I remember you from one of the Philly on Rails meetings.

Small world. See you at the next pub night?

Re:Introducing SelectorGadget: point and click minimal CSS s... by dominik on Thursday February 26, 2009 @05:08PM (#496513)
Excellent work; I also liked your screencast, you did a good job in quickly showing what SelectorGadget did!
Re:Introducing SelectorGadget: point and click minimal CSS s... by bprater on Thursday February 26, 2009 @05:30PM (#496539)
Agreed -- and then gave suggestions below. Perfect! I immediately started coming up with ways I could use it on a couple projects I'm working on.

I hope all purveyors of webapps will use this as a shining example of a demo well done.

Re:Introducing SelectorGadget: point and click minimal CSS s... by mattjaynes on Thursday February 26, 2009 @05:07PM (#496506)
Wow, this made my day. I've been using FireQuark (a custom firebug that provides CSS selectors - http://www.quarkruby.com/2007/9/5/firequark-quick-html-scree...) and while it was very helpful, SelectorGadget will remove sooo much more of the pain of scraping. Major kudos.

As an aside, I'll mention the nokogiri gem (almost identical to hpricot, but under much more active development), that's what I've been using and it's excellent. http://github.com/tenderlove/nokogiri/tree/master

Re:Introducing SelectorGadget: point and click minimal CSS s... by tectonic on Thursday February 26, 2009 @05:14PM (#496521)
Just so you know, there was, and may still be, an off-by-one error in Hpricot's implementation of nth-child that may confuse you when using the selectors generated by SelectorGadget.
Re:Introducing SelectorGadget: point and click minimal CSS s... by fizx on Thursday February 26, 2009 @05:52PM (#496568)
Re:Introducing SelectorGadget: point and click minimal CSS s... by mattjaynes on Thursday February 26, 2009 @05:45PM (#496558)
Great point. I haven't looked, but I think nokogiri fixes that bug. I think that was one tenderlove's motivations for creating nokogiri. He talks about it more on his blog:

http://tenderlovemaking.com/2008/10/30/nokogiri-is-released/

"I just want to tell you that you shouldn't worry about that old legacy code that uses Hpricot. Nokogiri can be used as a drop in replacement! Really! Nokogiri doesn't reproduce the bugs that are in Hpricot, but should work in most cases. Just use "Nokogir::Hpricot()" to parse your HTML. Of course, I've tried to keep the syntax of Hpricot that I like."

Re:Introducing SelectorGadget: point and click minimal CSS s... by andreyf on Thursday February 26, 2009 @07:19PM (#496650)
This is the kind of stuff that blows my mind. Between all of the people who will ever use it, you've probably saved a lifetime's worth of fiddling with CSS selectors. Kudos to you, sir!
Re:Introducing SelectorGadget: point and click minimal CSS s... by sam_in_nyc on Thursday February 26, 2009 @04:04PM (#496420)
Very nice tool. Reminds me of the Dapper interface. I could see this being used to build some sort of notifier service. For example, "notify me when any of these change."

Great work

Re:Introducing SelectorGadget: point and click minimal CSS s... by quilby on Thursday February 26, 2009 @05:13PM (#496520)
You are probably talking about - http://www.dapper.net/dapp-factory.jsp , which is basically a much more powerful 'selectorgadget'.

Edit: After using selectorgadget for a couple of minutes I found a case where selectorgadget works much better than dapper.net. selectorgadget is great!

Re:Introducing SelectorGadget: point and click minimal CSS s... by cpher on Thursday February 26, 2009 @04:02PM (#496415)
Very clever. It's like a souped-up version of the Outline Current Element tool in Firefox's Web Developer Toolbar. Nice work!
Re:Introducing SelectorGadget: point and click minimal CSS s... by CalmQuiet on Thursday February 26, 2009 @03:55PM (#496403)
Impressive flexibility. I haven't encountered any problems yet on FF or Safari.

Another use I see for it is in teaching JS / jQuery / etc.

Re:Introducing SelectorGadget: point and click minimal CSS s... by akikuchi on Friday February 27, 2009 @04:04PM (#497661)
Amazing timing on this release- I just learned the basics of CSS the other day, and this is going to be a really helpful tool to keep the learning process going. Well done and thanks!
Re:Introducing SelectorGadget: point and click minimal CSS s... by jrockway on Thursday February 26, 2009 @11:21PM (#496839)
OK, I know this is off topic, but... I read this article an hour or so ago, and I have had the Inspector Gadget theme song stuck in my head since then.

Someone make it stop :)

Re:Introducing SelectorGadget: point and click minimal CSS s... by misterbwong on Thursday February 26, 2009 @06:46PM (#496613)
Extremely useful. I love it. I've been using the Firefox Web Developer Toolbar to guess at my selectors, but this is infinitely faster.
Re:Introducing SelectorGadget: point and click minimal CSS s... by rjblackman on Thursday February 26, 2009 @06:49PM (#496616)
awesome. seems to work in chrome just fine. I can't see how this is useful for scraping though, is there scraping software that can take css selectors as criteria?

I've previously just used mechanize/hpricot and copied the xpath from firebug to get the areas i want to scrape.

Re:Introducing SelectorGadget: point and click minimal CSS s... by tectonic on Thursday February 26, 2009 @07:37PM (#496664)
Hpricot can take CSS selectors.
Re:Introducing SelectorGadget: point and click minimal CSS s... by dw0rm on Sunday March 01, 2009 @01:36AM (#498825)
lxml.cssselect in python
Re:Introducing SelectorGadget: point and click minimal CSS s... by jonny_noog on Friday February 27, 2009 @06:23AM (#497121)
Very cool. Thank you.

Thanks also for exposing me to screentoaster.com, I've been hoping for a service like this.

Re:Introducing SelectorGadget: point and click minimal CSS s... by tectonic on Tuesday March 10, 2009 @06:59PM (#510891)
I just pushed out XPath generation support to the dev version.
Re:Introducing SelectorGadget: point and click minimal CSS s... by PStamatiou on Thursday February 26, 2009 @10:30PM (#496793)
Andrew, this is badass! Great work.
Re:Introducing SelectorGadget: point and click minimal CSS s... by sarp on Thursday February 26, 2009 @05:29PM (#496537)
Brilliant!