码迷,mamicode.com
首页 > 其他好文 > 详细

selenium使用IE 浏览器问题

时间:2015-03-30 12:55:28      阅读:116      评论:0      收藏:0      [点我收藏+]

标签:

代码如下:
#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 浏览器问题

标签:

原文地址:http://www.cnblogs.com/nzyjlr/p/4377623.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!