Last active
May 23, 2021 12:13
-
-
Save dimitryzub/4730295d2818c328017950acd21c977a to your computer and use it in GitHub Desktop.
Scrape Google Scholar Profile Results using SerpApi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from serpapi import GoogleSearch | |
import os | |
params = { | |
"api_key": os.getenv("API_KEY"), | |
"engine": "google_scholar_profiles", | |
"hl": "en", | |
"mauthors": "samsung" | |
} | |
search = GoogleSearch(params) | |
results = search.get_dict() | |
for result in results['profiles']: | |
name = result['name'] | |
try: | |
email = result['email'] | |
except: | |
email = None | |
author_id = result['author_id'] | |
affiliation = result['affiliations'] | |
cited_by = result['cited_by'] | |
interests = result['interests'][0]['title'] | |
interests_link = result['interests'][0]['link'] | |
print(f'{name}\n{email}\n{author_id}\n{affiliation}\n{cited_by}\n{interests}\n{interests_link}\n') | |
# Part of the output: | |
''' | |
Jeong-Won Lee | |
Verified email at samsung.com | |
D41VK7AAAAAJ | |
Samsung Medical Center | |
107516 | |
Gynecologic oncology | |
https://scholar.google.com/citations?hl=en&view_op=search_authors&mauthors=label:gynecologic_oncology | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment