diff --git a/web_scrap.py b/web_scrap.py index d52b90b..adf2988 100644 --- a/web_scrap.py +++ b/web_scrap.py @@ -13,9 +13,11 @@ def mkdirPath(path_dir, logger): if not os.path.exists(repath): logger.debug("Dossier crée : {0}".format(repath)) try: - os.mkdir(repath) + if len(repath) > 0: + os.mkdir(repath) except Exception as err: logger.error("Directory error : {0}".format(err)) + logger.debug("Directory error : {0} {1} {2} {3} {4}".format(err, path_dir, repath, pathh, makedir)) exit(1) @@ -236,4 +238,4 @@ if __name__ == '__main__': if args.img is False: page_src = getImg(webpage, logger) - downloadPage(page_src, "{0}/{1}/{2}".format(args.dir, o.path, "img"), logger) \ No newline at end of file + downloadPage(page_src, "{0}/{1}/{2}".format(args.dir, o.path, "img"), logger)