Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

accessing the source using webbrowser control

0 views
Skip to first unread message

Chris Hunka

unread,
Jul 1, 2004, 3:59:39 AM7/1/04
to
does anyone know how to access the text based source of a web page presented
by the webbrowser control. I want to programatically save the source file
of the page presented in the webbrowser control (the same action as menu
View\Source or mouse right click, ViewSource).

regards

Chris


Gaurav - http://www.gauravcreations.com

unread,
Sep 12, 2004, 3:19:02 AM9/12/04
to
you could read the source if you access the web page through WinHttpRequest
object..

e.g

Set httpreqversion = New WinHttpRequest
httpreqversion.Open "GET", "htt://yourpage", True
httpreqversion.Send
httpreqversion.WaitForResponse (20)
source = httpreqversion.ResponseText 'string which will store teh response

--
Gaurav Creations


"ShepardBerry" wrote:

> Did you ever get this figured out. I'm trying to do the same thing and it's
> driving me nuts trying to get the source of the page.

ShepardBerry

unread,
Sep 13, 2004, 11:31:01 AM9/13/04
to
Yeah, I know about this way, but I need to display the page in the WebBrowser
control as well I'm working on a credit reporting system so I can't hit the
page twice as that would ding a customers credit report twice. Is there a
way to get the webbrowser to display the HTML after I get it this way?

Gaurav - http://www.gauravcreations.com

unread,
Sep 14, 2004, 1:35:02 AM9/14/04
to
u can try saving whatever response you get in a local file as html and then
display it on the browser control

ShepardBerry

unread,
Sep 14, 2004, 12:05:04 PM9/14/04
to
LOL.. Yeah I thought about that, but it is "privacy act" information and
that can't reside on the client box legally. Any other ideas?

Gaurav - http://www.gauravcreations.com

unread,
Sep 14, 2004, 2:19:02 PM9/14/04
to
but u can always delete/overwrite that file .say upon closing the application
or when the control goes to another url........ It will just be a temp.
file.. even a browser has to stores the page in a cache.......

Dave H

unread,
Oct 18, 2004, 10:00:03 AM10/18/04
to
ShepardBerry wrote:
> Did you ever get this figured out. I'm trying to do the same thing and it's
> driving me nuts trying to get the source of the page.
>
>
> "Chris Hunka" wrote:
>
>

Don't know if you found a solution but this posting might interest you -
works for me anyway - pops up a dialog box but you might be able to
suppress that with a bit of experimentation ???

Cheers Dave H.

From: "Nuno Pinto" <nuno...@estratega.pt>
Subject: Re: WebBrowser Control + SAVEAS
Date: Thursday, 16 September 2004 12:02 AM

Nora wrote:
> Hi,
> I was wondering if anybody could help me.. I am currently displaying
a web page in a WebBrowser control (in Microsoft Access 2002), and then
I want to do a 'Save As' to save the file to a new location. I have the
following line of code which works fine:
> WebBrowser.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_PROMPTUSER, "", ""
>
> My problem is that I need to get the full path of the new location of
the file, and I can't seem to figure it out. I would appreciate any advice.
>
> Thanks,
> Nora

Hi,

I use one thing: the IHTMLDocument2 interface found in the Microsoft
HTML Object Library.

Example:
...
Dim doc as IHTMLDocument2

Set doc = WebBrowser.document
doc.ExecCommand "Saveas", False, doc.URL
...

0 new messages