zoukankan      html  css  js  c++  java
  • selenium webdriver启动IE浏览器失败的解决办法

    通过selenium webdriver启动IE浏览器失败,报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.
    解决办法:修改浏览器安全设置---工具-Internet选项-安全-(Internet/本地Internet/受信任的站定/受限制的站点)启用保护模式全部勾选或全部去掉勾选。

    然后运行脚本出现如下问题:

    selenium.common.exceptions.WebDriverException: Message: Failed to navigate to http://www.baidu.com. This usually means that a call to the COM method IWebBrowser2::Navigate2() failed.

    解决办法:在生成webdriver对象之前,用脚本修改浏览器配置:

    from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
    DesiredCapabilities.INTERNETEXPLORER["ignoreProtectedModeSettings"] = True
  • 相关阅读:
    java课堂作业--异常处理
    Node.js 应用---定时给自己发送邮件
    JAVA课堂作业(2019.10.21)
    添加学生信息系统
    Hdfs的java必会Api操作
    架构之美2
    mybatis知识点03
    mybatis知识点总结02
    mybatis知识点总结01
    第四周周总结
  • 原文地址:https://www.cnblogs.com/fangfangs/p/6264190.html
Copyright © 2011-2022 走看看