I'm looking for some kind of "reverse CSS selectors": Given a HTML document how is it possible to look up fragments that have a specific formatting? For instance I would like to get a list of segments that use bold text (font-weight: bold;
). Given this document:
<h1>example</h1>
<p>This is <b>an example</b> with <span style="font-weight: bold">formatting</span>.
</p>
The list of segments would then include (for instance given via XPath selectors):
/h1[1]
/p[1]/b[1]
/p[1]/span[1]