Robert, This would be difficult in this situation. - Nicholas Paldino [.NET/C# MVP] |
Thursday, February 14, 2008 4:18 PM
|
Robert,
This would be difficult in this situation. You couldn't use the
WebBrowser control, because it needs to be tied to a UI thread.
You could use MSHTML through COM interop. However, you would have to
make sure that every thread that you use MSHTML on is set up so that the
ApartmentState for that thread is STA. I am not sure about this, but I also
believe you would have to pump messages in order for the events to work
correctly.
Needless to say, it's a better idea in this case to use
HttpWebRequest/HttpWebResponse and then take the content from those and set
the content of a new MSHTML instance in your thread to the content
downloaded. This way, you don't have to wait for MSHTML to download the
document, and you can work with it right away.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com |
 |
Thanks... I will look at HttpWebRequest/HttpWebResponse. - Robert Sheppard |
Thursday, February 14, 2008 5:54 PM
|
Thanks... I will look at HttpWebRequest/HttpWebResponse. The old VB6 crawler
that I am porting from was using the WebBrowser control, which works fine
but very slow. Let me stress SLOW.
Thanks again for the help.
also
set
want
parse |
 |
Robert, Do you have a specific need to parse the entire document, or are - Nicholas Paldino [.NET/C# MVP] |
Thursday, February 14, 2008 10:19 PM
|
Robert,
Do you have a specific need to parse the entire document, or are you
looking for specific parts? If you don't need to parse the entire document,
and what you are looking to scrape from the HTML is specific, then using
HttpWebRequest and HttpWebResponse will probably simplify things
considerably.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com |
 |