selinium python即错误 - 浏览器缩放

时间:2015-09-07 11:50:30

标签: python internet-explorer selenium selenium-webdriver automation

我是python的新手。当我执行下面的代码

时出现此错误
driver = webdriver.Ie(executable_path="<my IE DrIVER LOCATION>\IEDriverServer.exe")
driver.get("https://example.com")

我收到此错误:

File "C:\Python27\lib\site-packages\selenium\webdriver\ie\webdriver.py", line
55, in __init__
desired_capabilities=capabilities)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", l
ine 87, in __init__
self.start_session(desired_capabilities, browser_profile)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", l
ine 136, in start_session
'desiredCapabilities': desired_capabilities,
 File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", l
ine 196, in execute
self.error_handler.check_response(response)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py"
, line 181, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Unexpected error launchi
ng Internet Explorer. Browser zoom level was set to 94%. It should be set to 100%

我见过一些链接。但我找不到任何python。任何人都可以帮我解决这个问题,我可以以编程方式解决这个问题

1 个答案:

答案 0 :(得分:1)

将缩放级别更改为IE浏览器的100%。您可以通过单击位于浏览器右上角的齿轮图标来完成此操作。