IE11(Win11)selenium自动化报This is the initial start page for the WebDriver server.解决方案

本人使用IE11一直报This is the initial start page for the WebDriver server.错误,搜了很多方法例如修改Internet选项、修改注册表等等都试了,就是没有解决。

  1. 修改Internet选项,win11和网上搜出的结果,基本都不一样,所以解决无效

  1. 注册表也改了,也没用

  1. 使用python代码修改窗口缩放比例,也试了,也没用

zoom_level = driver.execute_script('return (window.outerWidth / window.innerWidth)')

print( zoom_level)

if zoom_level > 1:

driver.execute_script("document.body.style.zoom='1'")

print(driver.execute_script('return (window.outerWidth / window.innerWidth)'))

  1. 然后试一种方法,下载最新的IEWebDriver,IEDriverServer_x64_4.8.1,我下载了64位的,项目可以运行了,但是无比慢,超级慢,网上搜了方法,使用IEDriverServer_Win32_4.8.1,并放在python目录下,完美的解决了问题

下载地址:https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.8.0/IEDriverServer_Win32_4.8.1.zip

猜你喜欢

转载自blog.csdn.net/u012388338/article/details/129618868