Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Scrape Google Scholar Profile Results using SerpApi
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