simonw/shot-scraper

weired pdf error

Aperta

#76 aperta il 20 mag 2022

 (3 commenti) (0 reazioni) (0 assegnatari)Python (116 fork)github user discovery
bughelp wanted

Metriche repository

Star
 (2365 stelle)
Metriche merge PR
 (Merge medio 1h 5m) (1 PR mergiata in 30 g)

Descrizione

url to pdf ERROR b'Traceback (most recent call last):\n File "/opt/hostedtoolcache/Python/3.10.4/x64/bin/shot-scraper", line 8, in \n sys.exit(cli())\n File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/click/core.py", line 1130, in call\n return self.main(*args, **kwargs)\n File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/click/core.py", line 1055, in main\n rv = self.invoke(ctx)\n File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/click/core.py", line 1657, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/click/core.py", line 1404, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/click/core.py", line 760, in invoke\n return __callback(*args, **kwargs)\n File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packag...

pdfname=url.split('/')[-1]

if not os.path.exists(join(pdfpath,pdfname+'.pdf')):
    cmd='shot-scraper pdf {url} -o {pdfname}.pdf'
    isdone=subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
    out, err = isdone.communicate()

Guida contributor