BeautifulSoupSelect
I like the forgiving parsing of BeautifulSoup, and really enjoy the convenience wrapper soupselect.py. But I got sick of installing them separately. Since soupselect is MIT-licensed, here's a pypi package to simplify installation and provide a wrapper class.
Please note that SoupSelect is the work of Simon Willison. Its source can be found at
BeautifulSoup is Leonard Richardson's baby. It is merely a dependency here.
Installation
Should be as simple as pip install beautifulsoupselect
. Alternately, python setup.py install
.
Usage/doctest
>>> import beautifulsoupselect
>>> html = '<html><body><div id="foo">bar</div></body></html>'
>>> bss = beautifulsoupselect.BeautifulSoupSelect(html)
>>> bss('#foo')[0].text
u'bar'
Code (such as it is)
Contact
For bugs and feature requests, please file an issue:
https://github.com/sbma44/beautifulsoupselect/issues
For other stuff, I can be reached at:
thomas.j.lee (at) google's very popular webmail service