1.查看游览器版本
2.下载chrome 游览器驱动
地址:http://chromedriver.storage.googleapis.com/index.html
3.驱动放置 chrome 安装路径
4.编写代码读取url,调用chrome下载文件
import os
import sys
import time
from selenium import webdriver
browser = webdriver.Chrome(‘C:\Users\Conan\AppData\Local\Google\Chrome\Application\chromedriver.exe’)
url_list = []
def readtxt():
txtfile = open(‘D:\picture\story.txt’,‘r’,encoding=‘utf-8’)
line = txtfile.readline()
while line:
content = line.split()
geturl_list = content[2]
url_list.append(geturl_list)
line = txtfile.readline()
txtfile.close()
def getfile():
count = len(open(‘D:\picture\story.txt’,‘r’,encoding=‘utf-8’).readlines())
# print(count)
for i in range(count):
fileurl=url_list[i]
browser.get(fileurl)
time.sleep(6)
readtxt()
getfile()
#####################