我编写了一个脚本,使用python和Selenium打开Web浏览器。使用以下代码,它可以在Firefox上正常工作:
from selenium import webdriver driver = webdriver.Firefox()
当我用IE替换Firefox(开始输入时的建议值)时,我收到消息 IEDriver executable needs to be available in the path.
IEDriver executable needs to be available in the path.
from selenium import webdriver driver = webdriver.IE()
一个。下载 Windows32位驱动程序
要么
b。下载 Windows64位驱动程序
解压缩zip并将IEDriverServer.exe文件复制到某个位置,例如E:\ IEDriver
编写以下脚本
from selenium import webdriver browser = webdriver.Ie("e:\\IEDriver\\IEDriverServer.exe")