MSHTML Without the WebBrowser control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an application that runs as a service. It needs to parse a websites
dom using mshtml. The problem is, to get the document I'm trying to use the
WebBrowser control. That barfs though and says that the control can't run
unless the application is setup as STA. I've marked the thread that runs it
as STA, which allows it to run, but the WebBrowser control doesn't actually
navigate.

Is there any other way to load a document into MSHTML without the WebBrowser
Control?
 
Hi Joshua,

I remember I managed to interop into MSHTML to have it parse HTML, but it
still uses the WebBrowser behind the scenes. The biggest trouble is once an
HTML document to be parsed contains script, this script is executed (leading
either to script error pop-ups, or to message boxes if the script uses the
alert() function).

I'd suggest that you use a third-party parser for your scenario.
 
Back
Top