本文整理汇总了Python中selenium.webdriver.common.proxy.Proxy.proxy_autoconfig_url方法的典型用法代码示例。如果您正苦于以下问题:Python Proxy.proxy_autoconfig_url方法的具体用法?Python Proxy.proxy_autoconfig_url怎么用?Python Proxy.proxy_autoconfig_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类selenium.webdriver.common.proxy.Proxy
的用法示例。
在下文中一共展示了Proxy.proxy_autoconfig_url方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_pac_proxy_is_set_in_profile
# 需要导入模块: from selenium.webdriver.common.proxy import Proxy [as 别名]
# 或者: from selenium.webdriver.common.proxy.Proxy import proxy_autoconfig_url [as 别名]
def test_pac_proxy_is_set_in_profile():
profile = FirefoxProfile()
proxy = Proxy()
proxy.proxy_autoconfig_url = 'http://some.url:12345/path'
profile.set_proxy(proxy)
assert profile.default_preferences["network.proxy.type"] == ProxyType.PAC['ff_value']
assert profile.default_preferences["network.proxy.autoconfig_url"] == 'http://some.url:12345/path'
示例2: testCanAddPACProxyToDesiredCapabilities
# 需要导入模块: from selenium.webdriver.common.proxy import Proxy [as 别名]
# 或者: from selenium.webdriver.common.proxy.Proxy import proxy_autoconfig_url [as 别名]
def testCanAddPACProxyToDesiredCapabilities(self):
proxy = Proxy()
proxy.proxy_autoconfig_url = self.PAC_PROXY['proxyAutoconfigUrl']
desired_capabilities = {}
proxy.add_to_capabilities(desired_capabilities)
proxy_capabilities = self.PAC_PROXY.copy()
proxy_capabilities['proxyType'] = 'PAC'
expected_capabilities = {'proxy': proxy_capabilities}
self.assertEqual(expected_capabilities, desired_capabilities)
示例3: testCanAddPACProxyToDesiredCapabilities
# 需要导入模块: from selenium.webdriver.common.proxy import Proxy [as 别名]
# 或者: from selenium.webdriver.common.proxy.Proxy import proxy_autoconfig_url [as 别名]
def testCanAddPACProxyToDesiredCapabilities():
proxy = Proxy()
proxy.proxy_autoconfig_url = PAC_PROXY['proxyAutoconfigUrl']
desired_capabilities = {}
proxy.add_to_capabilities(desired_capabilities)
proxy_capabilities = PAC_PROXY.copy()
proxy_capabilities['proxyType'] = 'PAC'
expected_capabilities = {'proxy': proxy_capabilities}
assert expected_capabilities == desired_capabilities
示例4: test_pac_proxy_is_set_in_profile
# 需要导入模块: from selenium.webdriver.common.proxy import Proxy [as 别名]
# 或者: from selenium.webdriver.common.proxy.Proxy import proxy_autoconfig_url [as 别名]
def test_pac_proxy_is_set_in_profile(self):
# The setup gave us a browser but we dont need it
self.driver.quit()
self.profile = webdriver.FirefoxProfile()
proxy = Proxy()
proxy.proxy_autoconfig_url = 'http://some.url:12345/path'
self.profile.set_proxy(proxy)
assert self.profile.default_preferences["network.proxy.type"] == ProxyType.PAC['ff_value']
assert self.profile.default_preferences["network.proxy.autoconfig_url"] == 'http://some.url:12345/path'