473,785 Members | 2,879 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Save a web page

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("S cripting.FileSy stemObject")
Set filePtr = fs.CreateTextFi le("c:\abc.htm" , True)
filePtr.WriteLi ne (WebBrowser1.Do cument.body.inn erHTML)

Aug 26 '06 #1
3 3617
Jay
It doesnt work for the same reason i sent you the last post.

<fi**********@g mail.comwrote in message
news:11******** **************@ 74g2000cwt.goog legroups.com...
>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("S cripting.FileSy stemObject")
Set filePtr = fs.CreateTextFi le("c:\abc.htm" , True)
filePtr.WriteLi ne (WebBrowser1.Do cument.body.inn erHTML)

Aug 26 '06 #2

fi**********@gm ail.com wrote:
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("S cripting.FileSy stemObject")
Set filePtr = fs.CreateTextFi le("c:\abc.htm" , True)
filePtr.WriteLi ne (WebBrowser1.Do cument.body.inn erHTML)
---------------------------------------------------------------------------------------
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)
sp**********@gm ail.com
----------------------------------------------------------------------------------------

Aug 26 '06 #3

<fi**********@g mail.comwrote
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("S cripting.FileSy stemObject")
Set filePtr = fs.CreateTextFi le("c:\abc.htm" , True)
filePtr.WriteLi ne (WebBrowser1.Do cument.body.inn erHTML)
See if this example gets you a little farther along....

http://groups.google.com/group/micro...3aba0a0?hl=en&

LFS
Aug 26 '06 #4

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

Similar topics

10
3002
by: Martin Dale | last post by:
Dear all, Is there any way to activate the Save As command from Javascript. I would like to have a "Save as" button on a page which has been dynamically created (client side using document.writeln) so that the user can save a copy. I am working towards cross browser compatibility so any help for any browser would be good. I know I could put up a bit of text telling the user what the shortcut
4
4013
by: Nikhil Tayal | last post by:
Is there a way to write a file on the client machine from an aspx page? I've a custom query page and need to store the search criteria specified in an XML file on the user machine from my web page (aspx). I form the XML at run time from the search fileds specfied by the user and now my aspx page should save it on client machine so that the user can open the same query on next visit of the page. And help is appreciated. Nikhil
12
1863
by: Daniel Walzenbach | last post by:
Hi, I have a Website which allows users to input data. After they finished entering data they can click a button to save their input. Problem now is, that I have no possibility to visualize that the page is being saved and when it is (hopefully) done saving. I thought about a modal window being opened using JavaScript when they click the save button telling them that the data is being saved. After saving is completed I could use...
2
39775
by: fmakopo | last post by:
I am trying to save html page using C# because i want to save the page on the server not on the client side. I can do that using Javascript the problem that i am having i want to save the page on the server.
5
1956
by: hp_1981 | last post by:
Hi Is there anyway avoiding users to save my web pages? this idea came to my mind when I tried to save a web page, but in the middle of saving progress something like the following error occurred: "unable to save the page...". on the other hand, once, I saved a web page successfully, but when I opened it the characters were completely unreadable. unfortunately I can't remember the url now but if you know any way to restrict users,
3
8563
by: fiefie.niles | last post by:
I would like to save a web page to a file and have the hyperlinks work when I bring the file back up. If the web page has a hyperlink like the following <a href="OurWeb/News/abcFile.htm">, after saving the file and showing it on the screen, and you try to click on the link, it will try to go to C:\OurWeb\News\abcFile.htm instead of www.MyWebSite.com/OurWeb/News/abcFile.htm. If I am on the website www.MyWebSite.com, and do "File" - "Save...
12
4778
by: =?Utf-8?B?RnJlZU5FYXN5?= | last post by:
Hello, the scenario: There's an ASPX page which shows some text and has three buttons at the bottom: Save, Print and Close. Print and close is done by javascript. But how can I save the page on the client's computer? He/she could do this using the browser (file/save), but I need to have it done by pressing the pushbutton. In my serverside code I get the button-click-event, I also know how to get
2
1888
by: ppuniversal | last post by:
Hi All, My question is as follows: I have a text box and two links.Let the two links be - Show and Save . On clicking the Show , a web page is generated by fetching some data from database according to the input in the textbox and the web page is displayed to the user. Now on clicking Save also, with the same input to the textbox, the same set of data will be fetched from the database, but in this case I do not want the web page...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10329
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10152
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8974
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.