1、IE11驱动下载地址:
http://selenium-release.storage.googleapis.com/index.html
下载3.0.0的版本,将其放在C:\Windows\System32目录下(不用加入环境变量,默认在环境变量中)
检测代码如下:
from selenium import webdriver
driver=webdriver.Ie()
driver.get('https://lanhuapp.com/web/#/item?fid=all&commonly=all')
2、Chrome驱动的下载地址:(两个地址选任意一个皆可)
http://chromedriver.storage.googleapis.com/index.html
http://npm.taobao.org/mirrors/chromedriver/
(找到与浏览器版本对应的驱动,下载后放到python的安装根目录下)
检测代码如下:
from selenium import webdriver
driver=webdriver.Chrome()
driver.get('https://lanhuapp.com/web/#/item?fid=all&commonly=all')
3、Firefox驱动下载地址:
https://github.com/mozilla/geckodriver/releases
(下载版本为0.27.0,浏览器版本为80.0.1,驱动放在Python38\Scripts目录下)
检测代码如下:
from selenium import webdriver
driver=webdriver.Firefox()
driver.get('https://lanhuapp.com/web/#/item?fid=all&commonly=all')
4、Microsoft Edge驱动下载地址:
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
(找到与浏览器对应的版本,下载后将驱动放于浏览器同目录下:C:\Program Files (x86)\Microsoft\Edge\Application目录下)
检测代码如下:
from selenium import webdriver
driver=webdriver.Edge("C:\Program Files (x86)\Microsoft\Edge\Application\msedgedriver.exe")
driver.get('https://lanhuapp.com/web/#/item?fid=all&commonly=all')