1

I'm developing a project who analyzes web pages. I use an Java library for HTML parsing, and it returns an org.w3c.dom document.

Given a tag node in my dom document, I'd like to know all the CSS info connected to that node (including override/inheritance).

How I can do this? Searching on Google, I found some CSS parsers that generate an org.w3c.dom document, but how should I mix them?

  • This might be what you're looking for: http://stackoverflow.com/questions/754607/can-jquery-get-all-css-styles-associated-with-an-element – Billy Moat Jul 13 '12 at 15:24

1 Answers1

2

jStyleParser provides exactly this functionality. It parses all the referenced style sheets and maps them to the DOM tree nodes. More options are offered for a similar question here.

Community
  • 1
  • 1
radkovo
  • 868
  • 6
  • 10