Hi Mark,
Thanks for the reply, but actually that doesn't do what I
was talking about.
All this does is get the contents of the from the webserver.
However, what I
want is the rendered contents (which may or may not live on
a webserver). It
could just be a string of HTML stored in a database.
For example, if there was some javascript interspersed in
some HTML in there
that was:
Hello <script>document.write( getName()
);</script>,<BR>
<script>
var line = 'this is a line of text';
document.write( '<b>' + line + '</b>');
</script>
What I want to actually get is:
Hello jdoe,<BR>
"<b>this is a line of text</b>"
Hence my question about getting the *rendered* html.
Cheers!
Dave
----- Original Message -----
From: "Mark Kucera" <mkucera INTERCERVE.COM>
To: <DOTNET-WEB DISCUSS.DEVELOP.COM>
Sent: Thursday, December 07, 2006 1:50 PM
Subject: Re: [DOTNET-WEB] rendered HTML
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
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|