Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BeautifulSoup, but for CSS?

BeautifulSoup parses HTML and offers various ways to manipulate and search within HTML. Is there something similar for CSS?

Specifically, I'd like to know if a given HTML text is rendered as bold. Either it has an ancestor that is the <strong> or the <bold> tag (which can be done with BeautifulSoup), or it has an ancestor (or itself) that has CSS attributes with font-weight: bold.

Is this possible without resulting to writing my own library?

like image 463
Oliver Zheng Avatar asked Apr 26 '10 19:04

Oliver Zheng


1 Answers

Have a look to CSSParser class of cssutils package.

like image 198
systempuntoout Avatar answered Oct 20 '22 21:10

systempuntoout