无法在IE Internet选项中设置代理设置的IEDriverServer.exe [英] Unable to run IEDriverServer.exe with proxy set up in IE internet option

查看:1092
本文介绍了无法在IE Internet选项中设置代理设置的IEDriverServer.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在python中运行带有selenium的IEDriverServer.exe。

I tried to run IEDriverServer.exe with selenium in python.

from selenium import webdriver
webdriver.Ie("C:\Anaconda\IEDriverServer.exe")

但是,我收到错误代码:

However, I got error code:

WebDriverException                        Traceback (most recent call last)
<ipython-input-10-8d8fa329d2af> in <module>()
----> 1 webdriver.Ie("C:\Anaconda\IEDriverServer.exe")

C:\Anaconda\lib\site-packages\selenium-2.40.0-py2.7.egg\selenium\webdriver\ie\webdriver.pyc in __init__(self, executable_path, capabilities, port, timeout, host, log_level, log_file)
     44              host=self.host, log_level=self.log_level, log_file=self.log_file)
     45 
---> 46         self.iedriver.start()
     47 
     48         if capabilities is None:

C:\Anaconda\lib\site-packages\selenium-2.40.0-py2.7.egg\selenium\webdriver\ie\service.pyc in start(self)
     77             time.sleep(1)
     78             if count == 30:
---> 79                  raise WebDriverException("Can not connect to the IEDriver")
     80 
     81     def stop(self):

我发现工作中的防火墙正在停止webdriver.Ie即将启动。但webdriver.Firefox正常运行。我在IE互联网选项和http_proxy中设置代理。对于这个浏览器测试,我将不得不使用IE浏览器。不知道我怎么能得到webdriver.Ie要启动。

I discovered it's the firewall at work that's stopping webdriver.Ie to be launched. But webdriver.Firefox is running fine. I have proxy set up in IE internet options and as well as http_proxy. For this browser test, I will have to use IE. Not sure how I can get webdriver.Ie to fire up.

推荐答案

请参考以下问题:

Python:在urllib2中禁用http_proxy

快速修复(在调用webdriver之前插入):

Fast fix (insert this before invoking webdriver):

import urllib2
urllib2.getproxies = lambda: {}

这篇关于无法在IE Internet选项中设置代理设置的IEDriverServer.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆