About Me

Saturday, 19 May 2012

Fast Wepage Saver In Python

#it will create source.txt in the same directory

import urllib
import httplib
import socket

print "\n\nFast Webpage Saver"
print "input URL and run it. It will Save Webpage Within Seconds"

print "\n\n\t|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"
print "\t|||||                                          |||||"
print "\t|||||                                          |||||"
print "\t|||||Coded By Ajith KP         |||||"
print "\t|||||                                          |||||"
print "\t|||||                                          |||||"
print "\t|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"

try:
    url = raw_input("URL:")
    txt = open('savedpage.html','w')
    cobra = urllib.urlopen('http://'+url)
    for source in cobra.readlines():
        print source.rstrip()
        txt.write(source.rstrip())
    txt.close()
    cobra.close()
    raw_input('Complete: Open savedpage.html')
except (httplib.HTTPResponse, socket.error):
    print "\n\t[!] Session Cancelled; Error occured. Check internet settings"
except (KeyboardInterrupt, SystemExit):
    print "\t[x] Session cancelled"

Paste link - Click Here

0 comments:

Post a Comment