Skip to content

Instantly share code, notes, and snippets.

@scott2b
Last active May 9, 2018 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scott2b/fd343a820d9b5885af35af707ce24b92 to your computer and use it in GitHub Desktop.
Save scott2b/fd343a820d9b5885af35af707ce24b92 to your computer and use it in GitHub Desktop.
"""
Class for managing downloaded web pages
"""
import requests
import requests_cache
import uuid
requests_cache.install_cache()
class WebPage(object):
def __init__(self, url):
self.url = url
@property
def html(self):
return requests.get(self.url).text
@property
def uuid(self):
return uuid.uuid3(uuid.NAMESPACE_URL, self.url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment