Re: rendered HTML
Alex Smotritsky <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.web |
|---|---|
| Message-ID | <000c01c71a6d$31423b10$9c09a8c0@animal> |
This article which is currently linked to from the msdn home page may be relevant: http://msdn.microsoft.com/msdnmag/issues/06/12/cutting%20edge/default.aspx -----Original Message----- From: Discussion of building .NET applications targeted for the Web [mailto:[email protected]] On Behalf Of Fernando Tubio Sent: Thursday, December 07, 2006 1:45 PM To: [email protected] Subject: Re: [DOTNET-WEB] rendered HTML Forget everything I said. My memory failed me. I just checked with your example and it doesn't do what you want. Sorry, Fernando ----- Original Message ----- From: "Fernando Tubio" <[email protected]> To: <[email protected]> Sent: Thursday, December 07, 2006 5:34 PM Subject: Re: [DOTNET-WEB] rendered HTML I'm sure there must be better ways to do this, but in Firefox you can select the portion of the page, or Ctrl + A for the complete page, then in the context menu click on 'View Selection Source...' Another alternative could be Nikhil Kothari's Web Development Helper [1]. If you select the DOM Inspector, followed by the Markup tab, it will show you the current content of the page, both as a treeview and HTML. Fernando Tubio [1] http://projects.nikhilk.net/Projects/WebDevHelper.aspx ----- Original Message ----- From: "dave wanta" <[email protected]> To: <[email protected]> Sent: Thursday, December 07, 2006 4:56 PM Subject: Re: [DOTNET-WEB] rendered HTML 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" <[email protected]> To: <[email protected]> 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:[email protected]] On Behalf Of dave wanta Sent: Thursday, December 07, 2006 2:42 PM To: [email protected] 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 DevelopMentorR http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorR http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorR http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorR 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