导言
项目地址:GitHub - Ckend/scihub-cn: 国内环境下可用的scihub论文下载器
该项目能做啥,看图就明白了。一句话即可下载所需文献。
1.准备
开始之前,确保已有Python和pip环境。(直接安装anaconda3,建立一个虚拟环境更好)
Windows打开Cmd(开始—运行—CMD),或者打开anaconda3的虚拟环境运行。
苹果系统打开Terminal(command+空格输入Terminal),输入命令安装依赖:
pip install scihub-cn
会下载一系列的安装包,看到 Successfully installed ... 就代表成功安装scihub-cn。
scihub-cn是依赖 aiohttp 模块进行并发的下载,支持的最低Python版本为3.6。
项目源代码:GitHub - Ckend/scihub-cn: 国内环境下可用的scihub论文下载器
2.Scihub-cn 使用方法
2.1 使用DOI号下载论文
首先让我们来试试根据DOI号下载文献:
scihub-cn -d 10.1038/s41524-017-0032-0
下载的论文会自动生成在当前文件夹下:
选择将其下载到任意目录下,只需要添加 -o 参数:
scihub-cn -d 10.1038/s41524-017-0032-0 -o D:\papers
这将会把这篇论文下载到D盘的papers文件夹中。
2.2 根据关键词下载论文
使用 -w 参数指定一个关键词,可以通过关键词下载论文:
scihub-cn -w reinforcement
效果如下:
同样,它也支持-o参数指定文件夹。此外,这里默认使用的搜索引擎是百度学术,也可以使用Google学术、publons、science_direct等。通过指定 -e 参数即可:
scihub-cn -w reinforcement -e google_scholar
为了避免Google学术无法连接,可以增加代理 -p 参数:
scihub-cn -w reinforcement -e google_scholar -p http://127.0.0.1:10808
访问外网数据源的时候,增加代理能避免出现Connection closed等问题。
此外,还能限定下载的篇目, 比如希望下载100篇文章:
scihub-cn -w reinforcement -l 100
2.3 根据url下载论文
给定任意论文地址,可以让scihub-cn尝试去下载该论文:使用 -u 参数指定论文链接。
scihub-cn -u https://ieeexplore.ieee.org/document/26502
3.批量下载论文
增加了几种新的批量下载方式:
1. 根据给出所有论文名称的txt文本文件下载论文。
2. 根据给出所有论文url的txt文件下载论文。
3. 根据给出所有论文DOI号的txt文本文件下载论文。
4. 根据给出bibtex文件下载论文。
比如,根据给出所有论文URL的txt文件下载论文:
scihub-cn -i urls.txt --url
效果如下:
可以看到,文件内有4个论文链接,也成功地下载到了这4篇论文。
再试试放了DOI号的txt文件的批量下载:
scihub-cn -i dois.txt --doi
效果如下:
参数说明
可以输入 scihub-cn --help 看到更多的参数说明:
$scihub-cn --help
... ...
optional arguments:
-h, --help show this help message and exit
-u URL input the download url
-d DOI input the download doi
--input INPUTFILE, -i INPUTFILE
input download file
-w WORDS, --words WORDS
download from some key words,keywords are linked by
_,like machine_learning.
--title download from paper titles file
-p PROXY, --proxy PROXY
use proxy to download papers
--output OUTPUT, -o OUTPUT
setting output path
--doi download paper from dois file
--bib download papers from bibtex file
--url download paper from url file
-e SEARCH_ENGINE, --engine SEARCH_ENGINE
set the search engine
-l LIMIT, --limit LIMIT
limit the number of search result
主要用法总览
使用doi,论文标题,或者bibtex文件批量下载论文。
支持Python3.6及以上版本。
安装:
pip install scihub-cn
使用方法如下:
1.给出bibtex文件
$scihub-cn -i input.bib --bib
2.给出论文doi名称
$scihub-cn -d 10.1038/s41524-017-0032-0
3.给出论文url
$scihub-cn -u https://ieeexplore.ieee.org/document/9429985
4.给出论文关键字(关键字之间用_链接,如machine_learning)
$scihub-cn -w word1_words2_words3
5.给出论文doi的txt文本文件,比如
10.1038/s41524-017-0032-0
10.1063/1.3149495
$scihub-cn -i dois.txt --doi
6.给出所有论文名称的txt文本文件
Some Title 1
Some Title 2
$scihub-cn -i titles.txt --title
7.给出所有论文url的txt文件
url 1
url 2
$scihub-cn -i urls.txt --url
你可以在末尾添加-p(--proxy),-o(--output),-e(--engine),-l(--limit)来指定代理,输出文件夹、搜索引擎以及限制的搜索的条目数 搜索引擎包括 google_scholar、baidu_xueshu、publons、以及science_direct。
具体用法可访问源项目:GitHub - Ckend/scihub-cn: 国内环境下可用的scihub论文下载器