473,326 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Web Browser control getting the document downloaded

Hi,

Is there a way to get the current content of the web browser control? As in
the browser is the "View Source" functionality?

thanks.

/m
Nov 15 '05 #1
2 1901
Yeah, this is a pretty simple process.

You use the WebBrowser's document property to get the actual the HTML
document into an IHTMLDocument2 interface.

So it'll be something like this:
IHTMLDocument2 idoc = wb.document;

Then with the interface, you can get access to the body HTML using

string source = idoc.body.innerHTML;

But as i re-read your post, I notice the above solution only gives the
<body> HTML as opposed to the entire source. I've never really had to
do that before, but the above will give a start on what you'll need to
do. I imagine it's not much more difficult.
On Thu, 4 Dec 2003 23:05:13 +1100, "Muscha" <mu****@no.spam.net>
wrote:
Hi,

Is there a way to get the current content of the web browser control? As in
the browser is the "View Source" functionality?

thanks.

/m


Nov 15 '05 #2
If all you want is to get a string that contains the entire HTML
document, you can do:

string html = ((IHTMLDocument3)webBrowser.Document).documentElem ent.outerHTML;
"Muscha" <mu****@no.spam.net> wrote in message news:<OU**************@tk2msftngp13.phx.gbl>...
Hi,

Is there a way to get the current content of the web browser control? As in
the browser is the "View Source" functionality?

thanks.

/m

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Tony Marston | last post by:
If the use of the browser's BACK button is interfering with the operation of your web application then take a look at this article entitle "Back Button Blues" ...
0
by: amita | last post by:
hi, 1.I want to show a image file of type '.tif' in the browser window; for that I'm writting as ASP code page. 2.This '.tif' type image can be shown better with 'Kodak Image Control'. 3.To...
0
by: Hadi | last post by:
Hello, I'm using webbrowser control in my application and I am trying to get the source of the document. I have tried using: ((IHTMLDocument3)axWebBrowser.Document).documentElement.outerHTML;...
9
by: hzgt9b | last post by:
I am using a web browser control to display some PPT slides saved as HTML. My client has recently asked that the background of the browser be changed to sonething other than white so that the...
0
by: AlanF | last post by:
Here is my perplexing issue and I've looked EVERYWHERE for help (well almost everywhere.... probably should have started here :)) I am using a Webclient to successfully retrieve a "downloadata"...
0
by: Muscha | last post by:
Hi, Is there a way to get the current content of the web browser control? As in the browser is the "View Source" functionality? thanks. /m
0
by: John Mac | last post by:
I have a program that encapsulates the IE browser via the AxSHDocVw.AxWebBrowser technique. All works fine. It seems to me there should be a way to locate and wire up to an ActiveX/COM...
5
by: Mark Rae | last post by:
Hi, I'm writing a web app in VS.NET 2003, part of which allows users to download reports in the form of XML documents to their local machine for further processing. I'm using a 3rd-party Java...
10
by: Viken Karaguesian | last post by:
Hello everyone, Me again. Trying to learn some more :>) I hope I got the terminology right. How does a browser parse (correct term?) an HTML document. I'm sure that every browser does it a...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.