问题描述
我想从谷歌学者导出数据。特别是,我想导出引用特定论文的文章列表。如果我点击 Cited By
链接,我可以看到这个页面。我可以导出这些数据的一种方法是将它们全部添加到我的库中。然后您可以导出 4 种不同的格式(BibTex、Refman、Endnote、CSV)。但是,这些导出格式都没有包含每篇论文的 HTML 链接 (URL)。
另一种策略是抓取数据,但我不想这样做,因为我知道这对于谷歌学者的验证码可能非常棘手。
有没有办法导出包含每篇论文 URL 的谷歌学者搜索结果?
解决方法
对于您所在的页面,您的意思是?从控制台 (F12) 执行:
copy($$('li > a').map(a => a.href))
现在它们在您的剪贴板中。
,要提取 Cited by
数据,您需要 Cited by
链接所属的 Google 学术搜索自然搜索结果的 ID。您可以在 data-cid
html 属性中找到 ID。
然后您可以查询下一个链接以检索数据:https://scholar.google.com/scholar?q=info: this_is_where_you_put_the_cite_id:scholar.google.com/&output=cite
还有像 SerpApi 这样的第三方解决方案可以为您执行此操作。这是一个免费试用的付费 API。
示例 Python 代码(也可在其他库中使用):
from serpapi import GoogleSearch
params = {
"engine": "google_scholar_cite","q": "FDc6HiktlqEJ","api_key": "secret_api_key",}
search = GoogleSearch(params)
results = search.get_dict()
示例 JSON 输出:
"citations": [
{
"title": "MLA","snippet": "Schwertmann,U. T. R. M.,and Reginald M. Taylor. \"Iron oxides.\" Minerals in soil environments 1 (1989): 379-438."
},{
"title": "APA",& Taylor,R. M. (1989). Iron oxides. Minerals in soil environments,1,379-438."
},{
"title": "Chicago",{
"title": "Harvard",U.T.R.M. and Taylor,R.M.,1989. Iron oxides. Minerals in soil environments,pp.379-438."
},{
"title": "Vancouver","snippet": "Schwertmann UT,Taylor RM. Iron oxides. Minerals in soil environments. 1989 Jan 1;1:379-438."
}
],"links": [
{
"name": "BibTeX","link": "https://scholar.googleusercontent.com/scholar.bib?q=info:FDc6HiktlqEJ:scholar.google.com/&output=citation&scisdr=CgXpniNQGAA:AAGBfm0AAAAAYMu3WkYJI4po_pgcUVKgwwFp1dl5uNYk&scisig=AAGBfm0AAAAAYMu3WlZR_joxo-i8FTZ1CphjzmW_d447&scisf=4&ct=citation&cd=-1&hl=en"
},{
"name": "EndNote","link": "https://scholar.googleusercontent.com/scholar.enw?q=info:FDc6HiktlqEJ:scholar.google.com/&output=citation&scisdr=CgXpniNQGAA:AAGBfm0AAAAAYMu3WkYJI4po_pgcUVKgwwFp1dl5uNYk&scisig=AAGBfm0AAAAAYMu3WlZR_joxo-i8FTZ1CphjzmW_d447&scisf=3&ct=citation&cd=-1&hl=en"
},{
"name": "RefMan","link": "https://scholar.googleusercontent.com/scholar.ris?q=info:FDc6HiktlqEJ:scholar.google.com/&output=citation&scisdr=CgXpniNQGAA:AAGBfm0AAAAAYMu3WkYJI4po_pgcUVKgwwFp1dl5uNYk&scisig=AAGBfm0AAAAAYMu3WlZR_joxo-i8FTZ1CphjzmW_d447&scisf=2&ct=citation&cd=-1&hl=en"
},{
"name": "RefWorks","link": "https://scholar.googleusercontent.com/scholar.rfw?q=info:FDc6HiktlqEJ:scholar.google.com/&output=citation&scisdr=CgXpniNQGAA:AAGBfm0AAAAAYMu3WkYJI4po_pgcUVKgwwFp1dl5uNYk&scisig=AAGBfm0AAAAAYMu3WlZR_joxo-i8FTZ1CphjzmW_d447&scisf=1&ct=citation&cd=-1&hl=en"
}
]
查看documentation了解更多详情。
免责声明:我在 SerpApi 工作。