diff --git a/chapter5/1-getPageMedia.py b/chapter5/1-getPageMedia.py index 02869a8..9a5ba37 100644 --- a/chapter5/1-getPageMedia.py +++ b/chapter5/1-getPageMedia.py @@ -12,8 +12,7 @@ def getAbsoluteURL(baseUrl, source): elif source.startswith("http://"): url = source elif source.startswith("www."): - url = source[4:] - url = "http://"+source + url = "http://" + source[4:] else: url = baseUrl+"/"+source if baseUrl not in url: @@ -39,4 +38,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))