Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

soupselect. My simple extension to BeautifulSoup that allows you to grab elements using CSS selectors; should be useful for parsing microformats.

Tagged , , , ,

6 comments

  1. Fantastic job Simon!

    I was thinking about this exact thing some days ago after seeing that rails provides an assert function that uses css selectors for testing purpose.

    Thanks a lot!

    michele - 28th February 2007 15:04 - #

  2. Why not build this on top of html5lib? Would be pretty cool to have.

    Anne van Kesteren - 28th February 2007 15:20 - #

  3. michele: that's the exact reason I put this together; I'm using it for my unit tests.

    Anne: I'd love to see functionality like this in html5lib, but at the moment I'm just scratching my own itch.

    Simon Willison - 28th February 2007 15:25 - #

  4. FWIW, if someone does implement this with html5lib and is happy to release it under a MIT license, I would be very interested in including the functionality in the examples/ directory of the html5lib standard distribution.

    jgraham - 28th February 2007 17:45 - #

  5. Just a word of warning that BeautifulSoup 3.0.3 is needed for this. BS 2.x still has a large install base so it might trip some people up. Otherwise, awesome.

    anders pearson - 2nd March 2007 15:55 - #

  6. Thanks Anders; I've updated the site to reflect that.

    Simon Willison - 2nd March 2007 17:56 - #

Sign in with OpenID

Auto-HTML: Line breaks are preserved; URLs will be converted in to links.

Manual XHTML: Enter your own, valid XHTML. Allowed tags are a, p, blockquote, ul, ol, li, dl, dt, dd, em, strong, dfn, code, q, samp, kbd, var, cite, abbr, acronym, sub, sup, br, pre

A django site