代码如下:

#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 "<pyshell#7>", line 1, in <module>
    browser = webdriver.Ie()
  File "D:\python362\lib\site-packages\selenium\webdriver\ie\webdriver.py", line 82, in __init__
    desired_capabilities=capabilities)
  File "D:\python362\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 151, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "D:\python362\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 240, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "D:\python362\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 308, in execute
    self.error_handler.check_response(response)
  File "D:\python362\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, 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 same value (enabled or disabled) for all zones.

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

IEDriverServer启动IE报错

 

相关文章:

  • 2021-08-13
  • 2021-10-01
  • 2022-01-08
  • 2021-07-26
  • 2021-07-16
  • 2021-12-30
  • 2021-09-17
  • 2021-04-13
猜你喜欢
  • 2021-05-29
  • 2021-09-25
  • 2021-10-03
  • 2021-09-13
  • 2021-12-13
  • 2021-11-27
  • 2021-10-10
相关资源
相似解决方案