loop for url

This commit is contained in:
Valentin CZERYBA 2023-04-10 16:02:40 +02:00
parent 4ddc4a7cd3
commit aa5c8893ec

View File

@ -76,27 +76,33 @@ if __name__ == '__main__':
importWp.fromDirectory(args.directory)
exit(0)
if len(args.canalblog) > 0:
exportWp = WPExport.WPExport("", logger, args.parser, args.directory)
canalblog = args.canalblog.split(",")
for canal in canalblog:
try:
o = urlparse(args.canalblog)
o = urlparse(canal)
o = o._replace(scheme="https")
url = o.geturl().replace(":///", "://")
except Exception as err:
logger.error("parsing error : {0}".format(err))
exit(1)
exportWp = WPExport.WPExport(url, logger, args.parser, args.directory)
exportWp.setUrl(url)
webpage = exportWp.getUrlPage()
importWp.fromUrl(webpage)
if args.command == "export":
canalblog = args.url.split(",")
exportWp = WPExport.WPExport("", logger, args.parser, args.directory)
for canal in canalblog:
try:
o = urlparse(args.url)
o = urlparse(canal)
o = o._replace(scheme="https")
url = o.geturl().replace(":///", "://")
except Exception as err:
logger.error("parsing error : {0}".format(err))
exit(1)
exportWp = WPExport.WPExport(url, logger, args.parser, args.directory)
exportWp.setUrl(url)
if args.js is False:
exportWp.downloadJs()