Any way to tell a WebBrowser in C# to show the pages in HTML only? I'm trying to make a web scraper and I don't need pictures that make the process way slower than necessary.
+5
A:
Why are you using a WebBrowser control for page scraping? If you just want the core html of a page, then just do a WebRequest and get the response.
Jason
2010-07-23 21:29:53
Yea, actually I was expecting this answer. But is a long story. Basically, the whole interface as well as the internals of the program are based on the web page as seen from a web browser in order to make it user friendly. That's why this program is THIS program and not another program. Please just trust me, I DO need the WebBrowser.
jsoldi
2010-07-28 16:22:32
Even if you are using the WebBrowser control to display the page to the user, when the user saves the page you could still fire a WebRequest to get the content and save it.
Jason
2010-07-28 19:56:11
Already considered it. Won't work either. Not for this case. First, the WebBrowser's Document's DOM functions gives me a whole bunch of functions that a html parser doesn't (like calling javascript functions inside the webpage). And yea, these are functions that I use for scrapping, not for displaying stuff. Then, I would need to link clicked-elements in WebBrowser with elements in the parser, by perhaps adding an Id to the elements in the WebBrowser and then passing DocumentText to the... oh, wait. DocumentText doesn't update itself. Well this and lots of other things.
jsoldi
2010-07-29 04:21:09
+1
A:
you're going to have to roll your own basically.
One way would be to build your application in WPF and use a HTML->XAML conversion process and just leave off the tag from being converted.
Stephen Wrighton
2010-07-23 21:30:02