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?
Have a look to CSSParser class of cssutils package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With