simonw/shot-scraper

weired pdf error

Open

#76 opened on May 20, 2022

 (3 comments) (0 reactions) (0 assignees)Python (116 forks)github user discovery
bughelp wanted

Repository metrics

Stars
 (2,365 stars)
PR merge metrics
 (Avg merge 1h 5m) (1 merged PR in 30d)

Description

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()

Contributor guide