Last active
May 9, 2018 14:52
-
-
Save scott2b/fd343a820d9b5885af35af707ce24b92 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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