This file contains 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
import urllib.request | |
class HtmlDownloader(object): | |
def download(self, url): | |
if url is None: | |
return None | |
response = urllib.request.urlopen(url) | |
if response.getcode() != 200: | |
return None | |
return response.read() |