利用利用python下载下载scihub成文献为成文献为PDF操作操作
主要介绍了利用python下载scihub成文献为PDF操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小
编过来看看吧
scihub是科研利器,这就不多说了,白嫖文献的法门,一般采用的是网页或者桌面程序,一般都会跳转到网页进行加载出文
献,但是这很不方便,毕竟全手动,这里无意中看到一个写好的pip工具scihub2pdf ,于是试一下它手动威力,如果这能够成
功,也就是我们以后如果想批量下载也是没问题的。
1.首先我们得安装它:首先我们得安装它:
pip install scihub2pdf
2.紧接着安装紧接着安装npm和和phantomjs,因为这个代码里面使用了,因为这个代码里面使用了phantomjs
yum install npm
切换到国内源,威力网速给力,npm是nodejs的仓库,我们类比成python的pip即可
npm config set registry https://registry.npm.taobao.org
安装 phantomjs
npm install -g phantomjs
如果顺利成功的话,就可以试一下这个工具了
3.scihub2pdf的使用的使用
先来看一下使用帮助
[root@VM_0_9_centos ~]# scihub2pdf -h
usage: scihub2pdf [-h] [--input INPUTFILE] [--title] [--uselibgen]
[--location LOCATION] [--txt]
SciHub to PDF
----------------------------------------------------
Downloads pdfs via a DOI number, article title
or a bibtex file, using the database of libgen(sci-hub).
Given a bibtex file
$ scihub2pdf -i input.bib
Given a DOI number...
$ scihub2pdf 10.1038/s41524-017-0032-0
Given a title...
$ scihub2pdf --title An useful paper
Arxiv...
$ scihub2pdf arxiv:0901.2686
$ scihub2pdf --title arxiv:Periodic table for topological insulators
## Download from list of items
Given a text file like
```
10.1038/s41524-017-0032-0
10.1063/1.3149495
.....
```
download all pdf's
```
$ scihub2pdf -i dois.txt --txt
```
Given a text file like
```
Some Title 1
Some Title 2
.....
评论0