-
大小: 3KB文件類型: .py金幣: 1下載: 0 次發(fā)布日期: 2021-01-09
- 語言: Python
- 標簽: sci-hub??百度學(xué)術(shù)??
資源簡介
通過百度學(xué)術(shù)獲得doi號,再通過sci-hub進行論文下載,使用selenium+(pyautogui)+(autoit)進行操作,方便根據(jù)自己的需求進行重新編寫。。
代碼片段和文件信息
#?coding?=?utf-8
import?time
import?selenium
from?selenium?import?webdriver
import?numpy?as?np
import?os?
if?__name__?==?‘__main__‘:
#首先讀txt
#格式為?[1] Zhang?W?Wang?H?Hou?D?et?al.?“Reversible?data?hiding?in?encrypted?images?by?reversible?image?transformation”?IEEE?Trans.?Multimedia?vol.?18?no.?8?pp.?1469-1479?Oct.?2016.
#改變test名稱
file?=?open?(“test.txt“encoding=“UTF-8“)
list?=?file.readlines()
chromeOptions?=?webdriver.ChromeOptions()
#設(shè)置是否每次確定下載位置?可以跟autoit結(jié)合?方便改文件名
#prefs?=?{“download.prompt_for_download“:True}
prefs?=?{“download.default_directory“:?“e:\\allReferencesOfPaper“}
chromeOptions.add_experimental_option(“prefs“?prefs)
????#?啟動帶有自定義設(shè)置的Chrome瀏覽器
driver?=?webdriver.Chrome(chrome_options=chromeOptions)
for?file?in?list:
#找到文件名
file?=?fi
評論
共有 條評論