scholarly-python-package / scholarly

Retrieve author and publication information from Google Scholar in a friendly, Pythonic way without having to worry about CAPTCHAs!
https://scholarly.readthedocs.io/
The Unlicense
1.3k stars 292 forks source link

pg.FreeProxies() fails #458

Closed frafra closed 1 year ago

frafra commented 1 year ago

Describe the bug pg.FreeProxies() fails.

To Reproduce A minimal code snippet to reproduce the bug. If the bug is due to proxy issues and not exactly reproducible, please provide a code snippet and provide additional information under Additional context below.

>>> from scholarly import ProxyGenerator
>>> pg = ProxyGenerator()
>>> success = pg.FreeProxies()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/francesco.frassinell/.local/share/fades/e3663b59-ed29-42fd-a7f7-09bceeb84c8f/lib/python3.8/site-packages/scholarly/_proxy_generator.py", line 524, in FreeProxies
    proxy = self._proxy_gen(None)  # prime the generator
  File "/home/francesco.frassinell/.local/share/fades/e3663b59-ed29-42fd-a7f7-09bceeb84c8f/lib/python3.8/site-packages/scholarly/_proxy_generator.py", line 485, in _fp_coroutine
    all_proxies = freeproxy.get_proxy_list()
TypeError: get_proxy_list() missing 1 required positional argument: 'repeat'

Expected behavior It should work according to the documentation.

Desktop (please complete the following information):

Do you plan on contributing? Your response below will clarify whether the maintainers can expect you to fix the bug you reported.

arunkannawadi commented 1 year ago

Closing it as duplicate of #454. v1.7.4. should not have this issue, but I'm surprised you do. Can you confirm that that you have free-proxy version as 1.0.6 or earlier. You can do that in a python terminal

import fp
print(fp.__version__)
frafra commented 1 year ago

fp has no __version__ attribute. free-proxy version is 1.1.0, as there is no version restriction in setup.py: https://github.com/scholarly-python-package/scholarly/blob/e00d0eb7bb8165b521d16220f5beace34732fcc2/setup.py#L32. I think it should be added there too.

arunkannawadi commented 1 year ago

My bad. Please manually downgrade your free-proxy to an earlier version (1.0.6 I believe)

frafra commented 1 year ago

It worked flawlessly. Thanks for all your quick replies and fixes :)