1. 代码如下:
  1. #coding=utf-8
  2.  
  3. from selenium import webdriver
  4.  
  5. driver=webdriver.Ie()
  6.  
  7. driver.get('https://www.baidu.com')
  8.  
  9. print driver.title
  10.  
  11. driver.quit()
  1. 报错:
  2.  
  3. Traceback (most recent call last):
  4. File "D:\Users\xxxxx\workspace\aautotest\test_ie.py", line 12, in <module>
  5. driver=webdriver.Ie()
  6. File "D:\Python27\lib\site-packages\selenium\webdriver\ie\webdriver.py", line 54, in __init__
  7. desired_capabilities=capabilities)
  8. File "D:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 74, in __init__
  9. self.start_session(desired_capabilities, browser_profile)
  10. File "D:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 123, in start_se
  11. ssion
  12. 'desiredCapabilities': desired_capabilities,
  13. File "D:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 175, in execute
  14. self.error_handler.check_response(response)
  15. File "D:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 166, in check
  16. _response
  17. raise exception_class(message, screen, stacktrace)
  18. selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer
  19. . Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the s
  20. 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. VBA添加表格

    Sub 添加表格() ' If MsgBox("要为所有表格添加列吗?", vbYesNo + vbQuestion) = vbYes Then To ActiveDocument ...

  2. ref和out的区别?

    ref 和out的区别在面试中会常问到: 首先:两者都是按地址传递的,使用后都将改变原来参数的数值. 其次:ref可以把参数的数值传递进函数,但是out是要把参数清空,就是说你无法把一个数值从out传 ...

  3. 使用MySQL数据库

    登录到MySQL 当 MySQL 服务已经运行时, 我们可以通过MySQL自带的客户端工具登录到MySQL数据库中, 首先打开命令提示符, 输入以下格式的命名: mysql -h 主机名 -u 用户名 ...

  4. php5 date()获得的时间不是当前时间

    php自5.10起加入了时区的设置,在php中显示的时间都是格林威治标准时间,因此便与中国的用户会差八个小时. 修改php.ini中的 date.timezone 参数: [Date] ; Defin ...

  5. Oracle 11gR2 RAC修改SCAN IP

    一.查看当前环境: # grid用户 检查scan-ip地址的配置 [grid@node1 ~]$ srvctl config scan SCAN name: scan-cluster.com, Ne ...

  6. 问题记录-Fragment导包不同导致无法自动转型

    代码如下 public class MainActivity extends FragmentActivity { @Override public void onCreate(Bundle save ...

  7. ruby 笔记

    symbol 不能有- 'data-turbolinks-track' => true stop rails –s kill -INT $(cat tmp/pids/server.pid) cl ...

  8. python入门总结-函数

    函数形式: def functionname(paramlist): function body 局部变量不改变实参的值,如果需要改变,声明global.比如,global x 可以给函数默认值,注意 ...

  9. 比支付宝更好用的读IC卡信息工具

    编程语言:VC++ 更新时间:2014.10.23 操作系统:windowAll 工具:PCSC读卡器 在上一个博文<<解惑:NFC手机如何轻松读取银行卡信息?>>中,介绍了支 ...

  10. 算法系列2《RSA》

    1. RSA介绍 RSA公钥加密算法是1977年由Ron Rivest.Adi Shamirh和LenAdleman在(美国麻省理工学院)开发的.RSA取名来自开发他们三者的名字.RSA是目前最有影响 ...