Repository navigation
Closed
Description
Hi Vito, This is a neat tool you've got here, I came across this error when I tried to use --max-dwn-cites
Environment: Google Colab
Input:
!python -m PyPaperBot --query="Machine learning" --scholar-pages=1 --min-year=2018 --max-dwn-cites=10 --dwn-dir="\content\papers" --scihub-mirror="https://sci-hub.do"Output:
PyPaperBot is a Python tool for downloading scientific papers using Google Scholar, Crossref and SciHub.
If you like this project, you can give me a cup of coffee at --> https://www.paypal.com/paypalme/ferru97 <-- :)
Query: Machine learning
Google Scholar page 1 : 10 papers found
Searching paper 1 of 9 on Crossref...
Searching paper 2 of 9 on Crossref...
Python 3
Searching paper 3 of 9 on Crossref...
Python 3
Searching paper 4 of 9 on Crossref...
Python 3
Searching paper 5 of 9 on Crossref...
Python 3
Searching paper 6 of 9 on Crossref...
Python 3
Searching paper 7 of 9 on Crossref...
Python 3
Python 3
Searching paper 8 of 9 on Crossref...
Python 3
Searching paper 9 of 9 on Crossref...
Python 3
Papers found on Crossref: 8/9
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.7/dist-packages/PyPaperBot/__main__.py", line 148, in <module>
main()
File "/usr/local/lib/python3.7/dist-packages/PyPaperBot/__main__.py", line 145, in main
start(args.query, args.scholar_results, scholar_pages, dwn_dir, proxy, args.min_year , max_dwn, max_dwn_type , args.journal_filter, args.restrict, DOIs, args.scihub_mirror)
File "/usr/local/lib/python3.7/dist-packages/PyPaperBot/__main__.py", line 43, in start
to_download.sort(key=lambda x: int(x.sc_cites) if x.sc_cites!=None else 0, reverse=True)
File "/usr/local/lib/python3.7/dist-packages/PyPaperBot/__main__.py", line 43, in <lambda>
to_download.sort(key=lambda x: int(x.sc_cites) if x.sc_cites!=None else 0, reverse=True)
AttributeError: 'Paper' object has no attribute 'sc_cites'
Also when I tried to use --max-dwn-year
Input:
!python -m PyPaperBot --query="Machine learning" --scholar-pages=1 --min-year=2018 --max-dwn-year=10 --dwn-dir="\content\papers" --scihub-mirror="https://sci-hub.do"Output:
PyPaperBot is a Python tool for downloading scientific papers using Google Scholar, Crossref and SciHub.
If you like this project, you can give me a cup of coffee at --> https://www.paypal.com/paypalme/ferru97 <-- :)
Query: Machine learning
Google Scholar page 1 : 10 papers found
Searching paper 1 of 9 on Crossref...
Searching paper 2 of 9 on Crossref...
Python 3
Searching paper 3 of 9 on Crossref...
Python 3
Searching paper 4 of 9 on Crossref...
Python 3
Searching paper 5 of 9 on Crossref...
Python 3
Searching paper 6 of 9 on Crossref...
Python 3
Searching paper 7 of 9 on Crossref...
Python 3
Python 3
Searching paper 8 of 9 on Crossref...
Python 3
Searching paper 9 of 9 on Crossref...
Python 3
Papers found on Crossref: 8/9
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.7/dist-packages/PyPaperBot/__main__.py", line 148, in <module>
main()
File "/usr/local/lib/python3.7/dist-packages/PyPaperBot/__main__.py", line 145, in main
start(args.query, args.scholar_results, scholar_pages, dwn_dir, proxy, args.min_year , max_dwn, max_dwn_type , args.journal_filter, args.restrict, DOIs, args.scihub_mirror)
File "/usr/local/lib/python3.7/dist-packages/PyPaperBot/__main__.py", line 40, in start
to_download.sort(key=lambda x: int(x.sc_year) if x.sc_year!=None else 0, reverse=True)
File "/usr/local/lib/python3.7/dist-packages/PyPaperBot/__main__.py", line 40, in <lambda>
to_download.sort(key=lambda x: int(x.sc_year) if x.sc_year!=None else 0, reverse=True)
AttributeError: 'Paper' object has no attribute 'sc_year'
What's the reason for this🐺
Metadata
Metadata
Assignees
Labels
No labels
Activity
ferru97 commentedon Nov 1, 2021
Hi @Tolu1,
First of all thank you for your interest in PyPaperBot!
It's a silly naming error, I fix it in the day and release a new version.
I keep you updated.
ferru97 commentedon Nov 1, 2021
@Tolu1 now it should work, try it by downloading the new version v1.2.2
Tolu1 commentedon Nov 1, 2021
Hi @ferru97 thanks for your quick response, it appears your fix has broken something, I have created a new issue for that here #46
close ferru97#45 - v1.2.2 is out