fix path
This commit is contained in:
parent
21d24d638d
commit
77e61ef571
@ -123,12 +123,12 @@ def downloadPage(webpage, backup_dir, logger):
|
||||
filePageWeb = path_web[len(path_web)-1]
|
||||
path_web.pop(len(path_web)-1)
|
||||
dir_page_web = "/".join(path_web)
|
||||
mkdirPath("{0}/{1}".format(backup_dir, dir_page_web), logger)
|
||||
mkdirPath("{0}/{1}/{2}".format(backup_dir, o.netloc, dir_page_web), logger)
|
||||
r = requests.get(webpage[i])
|
||||
if r.status_code == 200:
|
||||
fileDownload = "{0}/index.html".format(backup_dir)
|
||||
fileDownload = "{0}/{1}/index.html".format(backup_dir, o.netloc)
|
||||
if len(dir_page_web) > 0 and len(filePageWeb) > 0:
|
||||
fileDownload = "{0}{1}/{2}".format(backup_dir, dir_page_web, filePageWeb)
|
||||
fileDownload = "{0}/{1}{2}/{3}".format(backup_dir, o.netloc, dir_page_web, filePageWeb)
|
||||
logger.info("{0}/{1} : {2}".format(i+1, len(webpage), fileDownload))
|
||||
open(fileDownload, "wb").write(r.content)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user