如何使用R或Python通过Google Scholar查询下载学术论文的PDF
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了如何使用R或Python通过Google Scholar查询下载学术论文的PDF,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2519字,纯文字阅读大概需要4分钟。
内容图文
![如何使用R或Python通过Google Scholar查询下载学术论文的PDF](/upload/InfoBanner/zyjiaocheng/725/2c05b077e5234598a1d0933006e427c9.jpg)
我有一份我需要下载的学术论文标题清单.我想写一个循环来从网上下载他们的PDF文件,但找不到办法.
以下是我到目前为止所考虑的一步一步(答案是欢迎使用R或Python):
# Create list with paper titles (example with 4 papers from different journals)
titles <- c("Effect of interfacial properties on polymer–nanocrystal thermoelectric transport",
"Reducing social and environmental impacts of urban freight transport: A review of some major cities",
"Using Lorenz curves to assess public transport equity",
"Green infrastructure: The effects of urban rail transit on air quality")
#Loop step1 - Query paper title in Google Scholar to get URL of journal webpage containing the paper
#Loop step2 - Download the PDF from the journal webpage and save in your computer
for (i in titles){
journal_URL <- query i in google (scholar)
download.file (url = journal_URL, pattern = "pdf",
destfile=paste0(i,".pdf")
}
Complicators:
循环步骤1 – Google学术搜索的第一个标题应该是论文的原始网址.但是,我听说Google学术搜索对Bots有点挑剔,所以替代方法是查询Google并获取第一个URL(跳转它会带来正确的URL)
循环步骤2 – 有些论文是门控的,所以我想有必要包含身份验证信息(user = __,passwd = __).但是,如果我正在使用我的大学网络,这种认证应该是自动的,对吗?
PS.我只需要下载PDF.我对获取文献计量信息(例如引文记录,h-index)不感兴趣.为获取文献计量数据,有一些指导here (R users)和here (python users).
解决方法:
Crossref有一个程序,发布者可以为该文章的全文版本链接提供元数据.不幸的是,对于像Wiley,Elsevier和Springer这样的发布商,他们可能会提供链接,但是您需要额外的权限来实际检索内容.有趣吗?无论如何,一些工作,例如,这适用于你的第二个标题,搜索crossref,然后获取全文的URL,如果提供,然后抓取xml,(优于PDF恕我直言)
titles <- c("Effect of interfacial properties on polymer–nanocrystal thermoelectric transport", "Reducing social and environmental impacts of urban freight transport: A review of some major cities", "Using Lorenz curves to assess public transport equity", "Green infrastructure: The effects of urban rail transit on air quality")
library("rcrossref")
out <- cr_search(titles[2])
doi <- sub("http://dx.doi.org/", "", out$doi[1])
(links <- cr_ft_links(doi, "all"))
$xml
<url> http://api.elsevier.com/content/article/PII:S1877042812005551?httpAccept=text/xml
$plain
<url> http://api.elsevier.com/content/article/PII:S1877042812005551?httpAccept=text/plain
xml <- cr_ft_text(links, "xml")
library("XML")
xpathApply(xml, "//ce:author")[[1]]
<ce:author>
<ce:degrees>Prof</ce:degrees>
<ce:given-name>Eiichi</ce:given-name>
<ce:surname>Taniguchi</ce:surname>
</ce:author>
内容总结
以上是互联网集市为您收集整理的如何使用R或Python通过Google Scholar查询下载学术论文的PDF全部内容,希望文章能够帮你解决如何使用R或Python通过Google Scholar查询下载学术论文的PDF所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。