HOW DO YOU WRITE A SCRIPT TO SAVE A COMPLETE WEBSITE? PYTHON, C++, OR RUBY?

Question by zuser00:
How do you write a script to save a complete website? Python, C++, or Ruby?
How do you write a script in (python, c++, or ruby) that saves a complete website? By complete website I mean the html file and the folder that holds all the images, javascript, and css files of the website. Normally this can be done by just Ctrl+S on any browser, but how do you write that into a script?
——————————————
Answer by Michael
Have you considered using a programme such as httrack? – http://www.httrack.com/
There is code available to incorporate httrack into python – http://www.satzbau-gmbh.de/staff/abel/httrack-py/
However a single command can be used to save a complete website without resorting to any scripting (python or otherwise). The httrack documentation includes the following example:
httrack “http://www.all.net/” -O “/tmp/www.all.net” “+*.all.net/*” -v
In this example, we ask httrack to begin the Universal Resource Locator (URL) http://www.all.net/ and store the results under the directory /tmp/www.all.net (the -O stands for “output to”) while not going beyond the bounds of all the files in the www.all.net domain and printing out any error messages along the way (-v means verbose).
——————————————
Add your own answer in the comments!









about 2 years ago
Open up the folder where your webpage files are located and right click on the page you want (mypage.html), then choose to select a program to open the file with. You can use either wordpad or notepad. All the html will be displayed, and you can save after adding the AdSense code. However, if you open up the file again with Webeasy 6, it may delete the code, so keep an extra copy on hand and check to make sure after the next time you use it.