Форум сайта python.su
\
def test(event): with open('C:\RetailBot\configs\proxy.json') as proxy_json: proxy = json.load(proxy_json) prox_driver = Proxy() prox_driver.proxy_type = ProxyType.MANUAL if proxy['get_type_proxy'] == 'HTTP': prox_driver.http_proxy = proxy['proxy'] if proxy['get_type_proxy'] == 'HTTPS': prox_driver.ssl_proxy = proxy['proxy'] if proxy['get_type_proxy'] == 'SOCKS 4/5': prox_driver.socks_proxy = proxy['proxy'] prox_driver.socks_username = proxy['get_login_proxy'] prox_driver.socks_password = proxy['get_password_proxy'] print(proxy) print(prox_driver) capabilities = webdriver.DesiredCapabilities.CHROME prox_driver.add_to_capabilities(capabilities) driver = webdriver.Chrome('C:\RetailBot\driver\chromedriver.exe', desired_capabilities=capabilities) driver.get("http://ipadresimnedir.com")
Офлайн