TalSchuster/BiorxivRetriever

Too many requests error

guidomeijer opened this issue · 1 comments

Thanks for writing this retriever! I'm sometimes, seemingly randomly, getting an HTTP error Too Many Request. I tried inserting some timeouts in the code but that didn't work.

Traceback (most recent call last):

File "C:\Users\guido\Repositories\biorxiv-first-said\bot_testing.py", line 20, in
papers = br.query('limit_from%%3A%s limit_to%%3A%s' % (str(today), str(today)), full_text=False)

File "C:\Users\guido\anaconda3\lib\site-packages\biorxiv_retriever_init_.py", line 99, in query
page_html = request.urlopen(biorxiv_url).read().decode("utf-8")

File "C:\Users\guido\anaconda3\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)

File "C:\Users\guido\anaconda3\lib\urllib\request.py", line 531, in open
response = meth(req, response)

File "C:\Users\guido\anaconda3\lib\urllib\request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)

File "C:\Users\guido\anaconda3\lib\urllib\request.py", line 569, in error
return self._call_chain(*args)

File "C:\Users\guido\anaconda3\lib\urllib\request.py", line 503, in _call_chain
result = func(*args)

File "C:\Users\guido\anaconda3\lib\urllib\request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)

HTTPError: Too Many Requests

Hi,

Glad you found the retriever useful. This is not an official interface but a wrapper that uses HTTP requests. Please follow the query limitations of BioRxiv