how do i set proxy for chrome in python webdriver -


I am using this code:

  Profile = webdriver.FirefoxProfile () Profile . set_preference ( "network.proxy.type", 1) profile.set_preference ( "network.proxy.http", "proxy.server.address") profile.set_preference ( "network.proxy.http_port", "port_number") profile. update_preferences () driver = webdriver.Firefox (firefox_profile = profile)  

Python webdriver the proxy set to FF. It works for FF How to set proxy in Chrome like this? I found this but not very useful when I run the script nothing happens (the Chrome browser does not start).

  selenium imports webdriver proxy = "23.23.23.23:3128" # ip: port or Host: Port chrome_options = webdriver.ChromeOptions () chrome_options.add_argument ( '- proxy-server =% s'% proxy) Chrome = webdriver.Chrome (chrome_options = chrome_options) chrome.get ( "http://whatismyipaddress.com")  

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -