Skip to content

Commit 80aad41

Browse files
Merge pull request #479 from scholarly-python-package/develop
Handle 302 redirect
2 parents aa707d1 + 69eae49 commit 80aad41

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

scholarly/_navigator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ def _get_page(self, pagerequest: str, premium: bool = False) -> str:
140140
continue # Retry request within same session
141141
else:
142142
self.logger.info("We can use another connection... let's try that.")
143+
elif resp.status_code == 302 and resp.has_redirect_location:
144+
self.logger.debug("Got a redirect.")
145+
pagerequest = resp.headers["location"]
143146
else:
144147
self.logger.info("""Response code %d.
145148
Retrying...""", resp.status_code)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name='scholarly',
8-
version='1.7.8',
8+
version='1.7.9',
99
author='Steven A. Cholewiak, Panos Ipeirotis, Victor Silva, Arun Kannawadi',
1010
author_email='steven@cholewiak.com, panos@stern.nyu.edu, vsilva@ualberta.ca, arunkannawadi@astro.princeton.edu',
1111
description='Simple access to Google Scholar authors and citations',

0 commit comments

Comments
 (0)