Brackson
卍卍卍卍卍卍卍卍卍卍卍
Current version: v1.1
(
PREVIOUS VERSIONS
This script allows you to take the HTML contents of a webpage, and store it in a text file. You do not to install any modules for this (AFAIK). If you want to parse the content before it's stored into the file, you can use
This would come in handy if you were building an archive site, if you want to log a website's content just because, etc.
I made this for educational purposes, and I thought I'd just release it because I don't really need it. Thanks for viewing!
Code:
#!/usr/bin/env python
import urllib2, os, time
def store_into_file():
url = 'http://google.com/' # URL that you want to mine.
data = urllib2.urlopen(url).read() # Get the HTML source of URL.
current_time = time.strftime('%H:%M:%S', time.localtime()) # Get the current time so we can use if for the txt filename.
r = open('%s.txt' % (current_time), 'w') # Create the file.
r.write(data) # Put the source in the file.
r.close() # Close the file.
def main():
store_into_file()
while True:
main()
You must be registered for see links
)PREVIOUS VERSIONS
-
You must be registered for see links
This script allows you to take the HTML contents of a webpage, and store it in a text file. You do not to install any modules for this (AFAIK). If you want to parse the content before it's stored into the file, you can use
You must be registered for see links
.This would come in handy if you were building an archive site, if you want to log a website's content just because, etc.
I made this for educational purposes, and I thought I'd just release it because I don't really need it. Thanks for viewing!
Last edited: