ferru97 / PyPaperBot

PyPaperBot is a Python tool for downloading scientific papers using Google Scholar, Crossref, SciHub, and SciDB.
MIT License
409 stars 77 forks source link

Earlier fix has broken current release\(º □ º l|l)/ #46

Open Tolu1 opened 3 years ago

Tolu1 commented 3 years ago

As a result of the fix in #45 Executing commands with or without --max-dwn-cites=10

!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"

Now results in

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
Paper not found...
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 48, in start
    Paper.generateReport(to_download,dwn_dir+"result.csv")
  File "/usr/local/lib/python3.7/dist-packages/PyPaperBot/Paper.py", line 65, in generateReport
    with open(path, mode="w", encoding='utf-8', newline='', buffering=1) as w_file:
FileNotFoundError: [Errno 2] No such file or directory: '/content/papers/result.csv'
ferru97 commented 3 years ago

I tested with the same command and it seems to work. Can you try again using a different empty output folder?

firmai commented 3 years ago

I have the same, this used to work fine, but not anymore

!python -m PyPaperBot --query="Semi-parametric models of spatial market integration" --scholar-pages=1 --scholar-results=1 --dwn-dir="/content" --scihub-mirror="https://sci-hub.st"

ferru97 commented 3 years ago

Ok I tested on linux and using as output floder /content it had a permission problem, but It worked using as output folder a folder in my home directory /home/user/content . Can you try again using as output folder something like /home/user/content?

Tolu1 commented 3 years ago

Google Colab might be causing this? I reverted back to v1.2.1 after I encountered this issue, it gave the same error.

Then just a few hours ago it worked fine for me with the current release v1.2.2.

!python -m PyPaperBot --query="Urban Resilience" --scholar-pages=7 --min-year=2017 --dwn-dir="/content/drive/MyDrive/Research/Papers/Test" --scihub-mirror="https://sci-hub.ee"

But now with the same command, nothing works

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: Urban Resilience

Google Scholar page 1 : 10 papers found
Paper not found...

Google Scholar page 2 : 10 papers found
Paper not found...

Google Scholar page 3 : 10 papers found
Paper not found...

Google Scholar page 4 : 10 papers found
Paper not found...

Google Scholar page 5 : 10 papers found
Paper not found...

Google Scholar page 6 : 10 papers found
Paper not found...

Google Scholar page 7 : 10 papers found
Paper not found...

Work completed!
If you like this project, you can offer me a cup of coffee at --> https://www.paypal.com/paypalme/ferru97 <-- :)

I ran the package on my local machine (windows) it seemed to work fine, so it could be a Google Colab environment specific issue?

ferru97 commented 3 years ago

Yes at this point I think is a Google Colab issue, I tested the v1.2.2 on both Linux and Windows and it seems to work as long as you have the permissions to write in the selected output folder.

@firmai do you also use the tool with Google Colab?

firmai commented 3 years ago

Yes, also use it with colab

ferru97 commented 1 month ago

Hi, sorry for the late reply, but PyPaperBot had been on standby until now. I've decided to resume development to improve it.

I've created a Telegram channel where you can suggest improvements, report bugs, or request custom data mining scripts. Feel free to join if you're interested with the following LINK

Thanks!