Is there any Python library that allows me to parse an HTML document similar to what jQuery
does?
i.e. I\'d like to be able to use CSS selectors
If you are fluent with BeautifulSoup, you could just add soupselect to your libs.
Soupselect is a CSS selector extension for BeautifulSoup.
Usage:
>>> from BeautifulSoup import BeautifulSoup as Soup
>>> from soupselect import select
>>> import urllib
>>> soup = Soup(urllib.urlopen('http://slashdot.org/'))
>>> select(soup, 'div.title h3')
[Science:
,
Star Trek
,
..]