loop for url
This commit is contained in:
parent
4ddc4a7cd3
commit
aa5c8893ec
@ -76,27 +76,33 @@ if __name__ == '__main__':
|
|||||||
importWp.fromDirectory(args.directory)
|
importWp.fromDirectory(args.directory)
|
||||||
exit(0)
|
exit(0)
|
||||||
if len(args.canalblog) > 0:
|
if len(args.canalblog) > 0:
|
||||||
|
exportWp = WPExport.WPExport("", logger, args.parser, args.directory)
|
||||||
|
canalblog = args.canalblog.split(",")
|
||||||
|
for canal in canalblog:
|
||||||
try:
|
try:
|
||||||
o = urlparse(args.canalblog)
|
o = urlparse(canal)
|
||||||
o = o._replace(scheme="https")
|
o = o._replace(scheme="https")
|
||||||
url = o.geturl().replace(":///", "://")
|
url = o.geturl().replace(":///", "://")
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
logger.error("parsing error : {0}".format(err))
|
logger.error("parsing error : {0}".format(err))
|
||||||
exit(1)
|
exit(1)
|
||||||
exportWp = WPExport.WPExport(url, logger, args.parser, args.directory)
|
exportWp.setUrl(url)
|
||||||
webpage = exportWp.getUrlPage()
|
webpage = exportWp.getUrlPage()
|
||||||
importWp.fromUrl(webpage)
|
importWp.fromUrl(webpage)
|
||||||
|
|
||||||
|
|
||||||
if args.command == "export":
|
if args.command == "export":
|
||||||
|
canalblog = args.url.split(",")
|
||||||
|
exportWp = WPExport.WPExport("", logger, args.parser, args.directory)
|
||||||
|
for canal in canalblog:
|
||||||
try:
|
try:
|
||||||
o = urlparse(args.url)
|
o = urlparse(canal)
|
||||||
o = o._replace(scheme="https")
|
o = o._replace(scheme="https")
|
||||||
url = o.geturl().replace(":///", "://")
|
url = o.geturl().replace(":///", "://")
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
logger.error("parsing error : {0}".format(err))
|
logger.error("parsing error : {0}".format(err))
|
||||||
exit(1)
|
exit(1)
|
||||||
exportWp = WPExport.WPExport(url, logger, args.parser, args.directory)
|
exportWp.setUrl(url)
|
||||||
if args.js is False:
|
if args.js is False:
|
||||||
exportWp.downloadJs()
|
exportWp.downloadJs()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user