Here's a little function that I've used for a while that
does just that.
public static string GetHtmlPage(string location)
{
string retVal;
WebResponse objResponse;
WebRequest objRequest =
System.Net.HttpWebRequest.Create(location);
objResponse = objRequest.GetResponse();
using (StreamReader sr = new
StreamReader(objResponse.GetResponseStream()))
{
retVal = sr.ReadToEnd();
}
return retVal;
}
Good Luck
MK
-----Original Message-----
From: Discussion of building .NET applications targeted for
the Web
[mailto OTNET-WE
B DISCUSS.DEVELOP.COM] On Behalf Of dave wanta
Sent: Thursday, December 07, 2006 2:42 PM
To: DOTNET-WEB DISCUSS.DEVELOP.COM
Subject: [DOTNET-WEB] rendered HTML
Hi All,
Since many web pages contain javascript to layout the page,
does anyone
know
how to get at the rendered HTML of a webpage filled with
javascript?
I'm
guessing you would some how need to create an instance of IE
or Firefox,
and
tap into something (I just don't know what that 'something'
is). I know
there used to be an IE tool (back in the v4.x days) where
you could
right-click in the browser window and select "view
rendered html". I
was
wondering if there was someway to do this in .NET.
Thanks,
Dave
===================================
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at
http://discuss.develop.com
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|