You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何获取Google Scholar个人主页的年度引用量总和?

获取Google Scholar个人主页的年度引用量总和

你已经成功提取了h指数、i10指数和总引用量,做得很棒!要获取图表中显示的年度引用量总和,我们可以定位到图表下方的年度数据表格,下面是扩展你现有代码的方法:

在创建完soup对象后,添加以下代码:

# 找到包含年度引用数据的表格
annual_table = soup.find("table", class_="gsc_g_tbl")

# 初始化字典存储年份-引用量的键值对
annual_citations = {}

# 遍历表格行(跳过表头行)
for row in annual_table.find_all("tr", class_="gsc_g_tr")[1:]:
    # 提取年份和对应的引用量
    year = row.find("td", class_="gsc_g_y").get_text(strip=True)
    citation_count = row.find("td", class_="gsc_g_c").get_text(strip=True)
    annual_citations[year] = citation_count

# 打印结果验证
print("年度引用量:")
for year, count in annual_citations.items():
    print(f"{year}年:{count}次")

关键说明:

  • 年度数据表格使用gsc_g_tbl类,每一行数据的类是gsc_g_tr
  • 跳过第一行是因为它是表头(包含"年份"和"引用量")
  • 使用get_text(strip=True)可以清除文本周围的多余空格,让数据更干净

如果你希望数据以元组列表的形式存储,而不是字典,可以稍微修改代码:

annual_citations_list = []
for row in annual_table.find_all("tr", class_="gsc_g_tr")[1:]:
    year = row.find("td", class_="gsc_g_y").get_text(strip=True)
    citation_count = row.find("td", class_="gsc_g_c").get_text(strip=True)
    annual_citations_list.append((year, citation_count))

这样你会得到类似[("2023", "150"), ("2022", "120"), ...]的列表,方便后续处理。

内容的提问来源于stack exchange,提问作者emax

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 04:51:15