我有一份需要下载的学术论文标题列表。我想写一个循环来从网上下载他们的 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")
}
并发症:
Loop step1 - Google Scholar 的第一个点击应该是论文的原始 URL。但是,我听说 Google Scholar 对 Bots 有点挑剔,所以另一种方法是查询 Google 并获取第一个 URL(跳跃它会带来正确的 URL)
循环步骤 2 - 一些论文是封闭的,所以我想有必要包含身份验证信息(user=__,passwd=__)。但是,如果我使用我的大学网络,则此身份验证应该是自动的,对吗?
附言。我只需要下载PDF。我对获取文献计量信息(例如引文记录、h-index)不感兴趣。为了获取文献计量数据,这里 (R 用户)和这里 (python 用户)有一些指导。