The Question:
BeautifulSoup provides a very limited support for CSS selectors. For instance, the only supported pseudo-class i
Officially, Beautifulsoup doesn't support all the CSS selectors.
If python is not the only choice, i strongly recommend JSoup (the java equivalent of this). It supports all the CSS selectors.
The other alternate way if you still want to stick with python, make it a jython implementation.
http://jsoup.org/
https://github.com/jhy/jsoup/