Save a web page

F

fiefie.niles

I would like to save a web page to a file. When I do that, sometimes
the saved web page does not look like the original web page.
For example, when I save www.msn.com, it looks very different the
original page.
How can I save the web page to look like the original (as if I do
"File" - "Save As" and under "Save as Type" select "Web Page, complete
(*.htm,*.html)" ? Thank you.

This is how I save the web page:
Set fs = CreateObject("Scripting.FileSystemObject")
Set filePtr = fs.CreateTextFile("c:\abc.htm", True)
filePtr.WriteLine (WebBrowser1.Document.body.innerHTML)
 
S

Sneha Menon

I would like to save a web page to a file. When I do that, sometimes
the saved web page does not look like the original web page.
For example, when I save www.msn.com, it looks very different the
original page.
How can I save the web page to look like the original (as if I do
"File" - "Save As" and under "Save as Type" select "Web Page, complete
(*.htm,*.html)" ? Thank you.

This is how I save the web page:
Set fs = CreateObject("Scripting.FileSystemObject")
Set filePtr = fs.CreateTextFile("c:\abc.htm", True)
filePtr.WriteLine (WebBrowser1.Document.body.innerHTML)

---------------------------------------------------------------------------------------
Hi FieFie

The reason for the different look is

(to put it very briefly)
Unlike the earlier times NOW there are a lot of
web authoring technologies/languages
that incorporate javascript, asp, php, DHtml, SHtml, CSS, perl, cgi and
so on
When a web page with straight HTML is saved to the hard disc
it also collects the image files linked from that page.
But in cases where other languages and technologies are used
the save method cannot grab ALL the resources needed to
display the page in its original layout

Some web authers purposely make their Javascript, CSS or
other resources unavailable for caching/Saving.
In some cases, it is by design.

As far as I know there is no legal methods to solve this
If it is that much important and..
If the site provides open for all FTP access, you shall
manually collect the resources and reconstruct the
directory Structure. (The second IF in this para
make it almost impossible)

There are some softwares of shady origin that would
grab the Whole Portal and download it to your PC
but do not go for that kind of unethical practices

Sneha (India)
(e-mail address removed)
----------------------------------------------------------------------------------------
 
L

Larry Serflaten

I would like to save a web page to a file. When I do that, sometimes
the saved web page does not look like the original web page.
For example, when I save www.msn.com, it looks very different the
original page.
How can I save the web page to look like the original (as if I do
"File" - "Save As" and under "Save as Type" select "Web Page, complete
(*.htm,*.html)" ? Thank you.

This is how I save the web page:
Set fs = CreateObject("Scripting.FileSystemObject")
Set filePtr = fs.CreateTextFile("c:\abc.htm", True)
filePtr.WriteLine (WebBrowser1.Document.body.innerHTML)

See if this example gets you a little farther along....

http://groups.google.com/group/microsoft.public.vb.general.discussion/msg/83d6cf7373aba0a0?hl=en&

LFS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top