代码如下:
#coding=utf-8

from selenium import webdriver

driver=webdriver.Ie()

driver.get('https://www.baidu.com')

print driver.title

driver.quit()
报错:

Traceback (most recent call last):
File "D:\Users\xxxxx\workspace\aautotest\test_ie.py", line 12, in <module>
driver=webdriver.Ie()
File "D:\Python27\lib\site-packages\selenium\webdriver\ie\webdriver.py", line 54, in __init__
desired_capabilities=capabilities)
File "D:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 74, in __init__
self.start_session(desired_capabilities, browser_profile)
File "D:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 123, in start_se
ssion
'desiredCapabilities': desired_capabilities,
File "D:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 175, in execute
self.error_handler.check_response(response)
File "D:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 166, in check
_response
raise exception_class(message, screen, stacktrace)
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 s
ame value (enabled or disabled) for all zones.

解决办法:把ie的保护模式都选上或都勾掉就可以了:

selenium使用IE 浏览器问题的更多相关文章

  1. (原创)如何使用selenium 驱动chrome浏览器并且打开方式为手机模式-转载请注明出处

    随着移动设备使用率的不断增加,移动页面的测试也变得越来越重要. 对于互联网公司M站的测试,如果不通过专用的appium等移动端测试工具是否还有方便快捷的办法呢?答案当然是有啊. 使用chrome dr ...

  2. selenium + python 多浏览器测试

    selenium + python 多浏览器测试 支持库包 在学习 Python + Selenium 正篇之前,先来看下对多浏览器模拟的支持.目前selenium包中已包含webdriver,hel ...

  3. Selenium IDE- 不同的浏览器

    Selenium IDE- 不同的浏览器 Selenium IDE脚本只能对火狐的工具Firefox插件运行测试.使用Selenium-IDE开发的测试可以对其他浏览器所保存为Selenium网络驱动 ...

  4. selenium 启动ie 浏览器

    selenium 启动ie 浏览器 var driver = new InternetExplorerDriver(@"IEDriverServer.exe路径"); driver ...

  5. Selenium Grid跨浏览器-兼容性测试

    Selenium Grid跨浏览器-兼容性测试 这里有两台机子,打算这样演示: 一台机子启动一个作为主点节的hub 和 一个作为次节点的hub(系统windows 浏览器为ie) ip为:192.16 ...

  6. selenium+谷歌无头浏览器爬取网易新闻国内板块

    网页分析 首先来看下要爬取的网站的页面 查看网页源代码:你会发现它是由js动态加载显示的 所以采用selenium+谷歌无头浏览器来爬取它 1 加载网站,并拖动到底,发现其还有个加载更多 2 模拟点击 ...

  7. selenium与chrome浏览器及驱动的版本匹配

    用selenium+python+webdriver完成UI功能自动化,经常会碰到浏览器版本与驱动的版本不匹配而引起报错,下面就selenium与chrome浏览器及驱动的版本匹配 做个总结. 使用W ...

  8. selenium自动化打开浏览器不受信任解决办法

    之前在用selenium(火狐浏览器)打开一个https网站时,总是弹出不受信任,修改配置后,每次加载的浏览器都是还原了配置,无法加载出页面,这里给出解决办法:让浏览器去加载我们修改后的配置,具体如下 ...

  9. selenium WebDriver 对浏览器标签页的切换

    关于selenium WebDriver 对浏览器标签页的切换,现在的市面上最新的浏览器,当点击一个链接打开一个新的页面都是在浏览器中打开一个标签页,而selenium只能对窗口进行切换的方法,只能操 ...

  10. Python selenium + Firefox启动浏览器

    Python selenium 的运用 from selenium import webdriver # from selenium.webdriver.firefox.firefox_profile ...

随机推荐

  1. php判断是否为json格式的方法

    php判断是否为json格式的方法. 首先要记住json_encode返回的是字符串, 而json_decode返回的是对象 判断数据不是JSON格式: 复制代码代码如下: function is_n ...

  2. 通过JAVA代码获取手机的一些基本信息(本机号码,SDK版本,系统版本,手机型号)

    代码如下: package com.zzw.getPhoneInfos; import android.app.Activity; import android.content.Context; im ...

  3. Jquery note

    the purpose: write less. do more   写得少,做更多 jquery 基本选择器, $("p ,div ")匹配所有的P元素和DIV元素 , $(&q ...

  4. 下一代NoSQL:最终一致性的末日

    相比关系型数据库,NoSQL解决方案提供了shared-nothing.容错和可扩展的分布式架构等特性,同时也放弃了关系型数据库的强数据一致性和隔离性,美其名曰:"最终一致性". ...

  5. Hive启动时的棘手问题的处理

    Hive是存在于Hadoop集群之上的数据仓库,作为大数据处理时的主要工具,对于大数据开发人员的重要性不言而喻.当然要使用Hive仓库的前提就是对于hive的安装,hive的安装是很简单的过程,主要关 ...

  6. 包(package) 与 导入(import) 语句剖析

    A) 包(package):用于将完成不同功能的类分门别类,放在不同的目录下. B)命名规则:将公司域名翻转作为包名.例如www.vmaxtam.com域名,那么包名就是com.vmaxtam 每个字 ...

  7. hdu 1973 Prime Path

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=1973 Prime Path Description The ministers of the cabi ...

  8. android开发分辨率问题解决方案

    dpi是什么呢?dpi是“dot per inch”的缩写,每英寸像素数.四种密度分类: ldpi (low), mdpi (medium), hdpi (high), and xhdpi (extr ...

  9. OC中的NSNumber、NSArray、NSString的常用方法

    和C语言不同,在Objective-C语言中,有单独的字符串类NSString.C语言中,string是由 char(ASCLL码)字符组成 OC中,字符串是由unichar(Unicode)字符组成 ...

  10. 插入排序 & 快速排序

    2.1 插入排序: 接口定义: int insert_sort(void* data, int size, int esize, int (*compare)(const void* key1, co ...