Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions chapter5/1-getPageMedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def getAbsoluteURL(baseUrl, source):
url = source
elif source.startswith("www."):
url = source[4:]
url = "http://"+source
url = "http://"+url
else:
url = baseUrl+"/"+source
if baseUrl not in url:
Expand All @@ -39,4 +39,4 @@ def getDownloadPath(baseUrl, absoluteUrl, downloadDirectory):
fileUrl = getAbsoluteURL(baseUrl, download["src"])
if fileUrl is not None:
print(fileUrl)
urlretrieve(fileUrl, getDownloadPath(baseUrl, fileUrl, downloadDirectory))
urlretrieve(fileUrl, getDownloadPath(baseUrl, fileUrl, downloadDirectory))