Skip to content

Fill author cannot handle 302 redirects #469

@thelondonsimon

Description

@thelondonsimon

Describe the bug
When calling fill() on an author record whose scholar_id has a 302 redirect, scholarly gets stuck in a loop on the original URL.

To Reproduce

from scholarly import scholarly
import logging

logging.basicConfig(level=logging.INFO)

scholar_id = 'oMaIg8sAAAAJ'
author = scholarly.search_author_id(scholar_id, filled = True)

Results in logging such as:

INFO:scholarly:Getting https://scholar.google.com/citations?hl=en&user=oMaIg8sAAAAJ&pagesize=100
INFO:scholarly:Getting https://scholar.google.com/citations?hl=en&user=oMaIg8sAAAAJ&cstart=100&pagesize=100
INFO:scholarly:Getting https://scholar.google.com/citations?hl=en&user=oMaIg8sAAAAJ&cstart=200&pagesize=100
INFO:scholarly:Getting https://scholar.google.com/citations?hl=en&user=oMaIg8sAAAAJ&cstart=300&pagesize=100
INFO:scholarly:Getting https://scholar.google.com/citations?hl=en&user=oMaIg8sAAAAJ&cstart=400&pagesize=100
...

Expected behavior
The 302 redirect will be observed and results will be the same as for searching for scholar_id = 'PEJ42J0AAAAJ'

Desktop (please complete the following information):

  • Proxy service: None
  • python version: 3.9.14
  • OS: Linux
  • Version: Centos Stream 9

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions