tags:

views:

57

answers:

2

Hi, I'm now using AxWebBrowser component to get DOM from web page and find used styles on each element. Unfortunatelly this is not working perfectly and some elements doesn't return correct data.

I'm thinking about if it's possible to use engine from firefox? Is there some dll library I can use, navigate to the page and go throw DOM of the page?

A: 

You can get the document text and parse DOM with some other way - HtmlAgilityPack for example.

TcKs
My biggest reqiurement is to get the applied CSS, do you know if this is possible with this? AxWebBrowser has currentStyle property for each element which contains information about applied style - but it's not working in some cases.
martin.malek
AxWebBrowser has a lot of bugs if you want work with attributes of tags. You can try get the tag's OuterHtml, which contains correct text/html. This string you can pass into HtmlAgilityPack (or another parser) and read the "class" and/or "style" attribute.If you want to get the concrete values of style, you propably need parse the CSS file and search in them for the specified class.However - AxWebBrowser has several bugs which are hidden (they don't throw any exception, but result/behaviour is not correct) :(.
TcKs
A: 

If you just want the DOM from a webpage - say for scraping purposes, and not for display - you might find the Crowbar project useful:

http://simile.mit.edu/wiki/Crowbar

stusmith