A
A
agent_22032020-12-07 11:22:54
Python
agent_2203, 2020-12-07 11:22:54

How to use seleniumwire.webdriver.Remote with proxy in python?

When using, there was a need to use socks5 auth proxy, usually I did it like this

from seleniumwire import webdriver

options = {
        'proxy': {
            'http': "socks5h://" + proxy,
            'https': "socks5h://" + proxy,
            'no_proxy': 'localhost,127.0.0.1' # ,dev_server:8080
            }
        }
webdriver.Firefox(
        seleniumwire_options=options
)


And how to do it in this case?

from seleniumwire import webdriver

selenium_url = "http://localhost:4444/wd/hub"
caps = {'browserName': 'chrome'}
driver = webdriver.Remote(
           command_executor=selenium_url, 
           desired_capabilities=caps
         )

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question