2016-05-05 11:23:15 +00:00
|
|
|
import urllib.request
|
|
|
|
|
|
|
|
def download(url):
|
2016-08-14 08:45:00 +00:00
|
|
|
assert url
|
2016-05-05 11:23:15 +00:00
|
|
|
request = urllib.request.Request(url)
|
|
|
|
request.add_header('Referer', url)
|
|
|
|
with urllib.request.urlopen(request) as handle:
|
|
|
|
return handle.read()
|