scholarly is a Python module designed to programmatically retrieve author and publication information from Google Scholar, effectively bypassing CAPTCHA challenges. Currently at version 1.7.11, the library maintains an active development cycle with frequent updates to adapt to changes in Google Scholar's structure and anti-bot measures.
pip install scholarlyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to search for an author, retrieve their full profile and publications, and find papers that cite a specific publication. It also includes an example of how to set up a `ProxyGenerator` for robust scraping, which is crucial for reliably interacting with Google Scholar's anti-bot mechanisms.
Update your code to use `httpx` compatible patterns or ensure `scholarly` is isolated from other `requests`-dependent code. If using `httpx` directly, ensure compatibility.
Always use a `ProxyGenerator` instance with `scholarly.use_proxy()`. Consider using premium proxy services (like ScraperAPI, Bright Data) for higher reliability, or `pg.FreeProxies()` as a free alternative (less robust).
Migrate to other proxy methods, such as `FreeProxies()` or premium services via `ScraperAPI()`/`BrightData()`. If you still wish to use Tor, you must install `scholarly` with the `[tor]` extra (e.g., `pip install scholarly[tor]`).
Upgrade to `scholarly` version 1.7.8 or newer: `pip install --upgrade scholarly`.
Update to version 1.7.11 or newer to benefit from improved handling of `scholar_id` redirects.
Implement a robust proxy strategy using `scholarly.use_proxy(ProxyGenerator())`. For persistent scraping, consider a paid proxy service (e.g., ScraperAPI) or ensure `pg.FreeProxies()` is working correctly. Add delays between requests if scraping in a loop.
After getting an initial author object (e.g., `next(search_query)`), call `scholarly.fill(author_object)` to retrieve comprehensive details like publications, co-authors, and citation counts. For specific sections, use `scholarly.fill(author_object, sections=['publications'])`.
Rename your local `scholarly.py` file to something else (e.g., `my_script.py`) or run your script from a directory where no such file exists.
Ensure you are using the correct access pattern for your `scholarly` version. The current recommended way to access bibliographic data is `pub['bib']['title']` (for dictionary-like access) and `scholarly.citedby(pub)` (for generator). Upgrade to the latest `scholarly` version for consistency.