0

When I Googled the problem myself, people suggest to do it this way:

WebBrowser web = new WebBrowser;
web.DocumentText = htmlString;
HtmlDocument doc = web.Document;

This leaves doc as null. Any idea what could be going wrong? Debugging in Visual Studio seems to tell me that this:

web.DocumentText = htmlString;

doesn't do anything. Any help would be appreciated! Thanks.

Clint
  • 33
  • 5
  • 1
    You need to wait for it to load. – SLaks Oct 16 '13 at 18:42
  • @SLaks Yes. A lot of websites have said the same thing. I put a while loop in the program that runs until the WebBrowser's ready state is 'Complete'. Not much luck. I should mention that I am programming this as a console application - does that change anything? – Clint Oct 16 '13 at 18:52
  • You need an STA thread and a message loop for this to work with a console app. E.g., http://stackoverflow.com/a/18675926/1768303 – noseratio Oct 18 '13 at 13:02

0 Answers0