diff --git a/chapter5/1-getPageMedia.py b/chapter5/1-getPageMedia.py index 9aafa69..81126f7 100644 --- a/chapter5/1-getPageMedia.py +++ b/chapter5/1-getPageMedia.py @@ -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: @@ -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)) \ No newline at end of file + urlretrieve(fileUrl, getDownloadPath(baseUrl, fileUrl, downloadDirectory))