I’m using Ruby and Nokogiri to parse HTML documents, and I would like to select all nodes matching a CSS class, which I don’t know in advance, but have the display: none style attribute.
Example:
<html>
<body>
<p class="visibleTopics">Visible Topic Content</p>
<p class="invisibleTopics">Invisible Topic Content</p>
</body
</html>
and in other file it’s defined:
.invisibleTopic {
display: none
}
I’d like to select the node with invisibleTopics content by its style display: none. Any suggestions?
Nokogiri doesn’t compute styles. You need a browser for that. With Watir-Webdriver you would do: