zoukankan      html  css  js  c++  java
  • python webdriver启动IE浏览器

    from selenium import webdriver
    from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
    from selenium.webdriver.common.proxy import *
    iedriver='C:Program Files (x86)Internet ExplorerIEDriverServer.exe'
    driver = webdriver.Ie(iedriver)
    driver.get("http://c.highpin.cn")

     
    说明:
    下载IEDriverServer,放到Internet安装路径内
    赋值IEDriverServer的路径到iedriver变量,启动时通过webdriver.Ie(iedriver)启动
     
    遇到的问题:
    1.只启动了iedriver,但是没有打开IE浏览器
    解决方法:先启动fiddle,再去执行脚本,可以正常打开IE浏览器
    说明:因为公司内部网络的原因,有代理,通过启动时加代理的方法我没有加成功,所以不确定是否可以解决这个问题。fiddle启动时会更改浏览器的代理,具体机制大家可以自己了解一下。
     
    2.启动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.
     
    解决方法:打开IE浏览器,工具->internet选项->安全,将Internet,本地Intranet,可信站点,受限站点下的启用保护模式选项统一(都勾选或都不勾选)
  • 相关阅读:
    oracle11g数据库安装
    WIN7+QT5.2.0 连接oracle11g问题及解决方法
    WIN7+Qt5.2.0连接oracle数据库的oci驱动的编译
    Qt编译Oracle OCI驱动
    Qt 中 Oracle 数据库 QOCI 驱动问题及解决
    qt QThread
    Qt之模型/视图(自定义风格)
    Qt之模型/视图(实时更新数据)
    Qt之模型/视图(委托)
    AE地图查询
  • 原文地址:https://www.cnblogs.com/meitian/p/4837912.html
Copyright © 2011-2022 走看看