How to set authentication socks proxy on docker Selenium Grid
See original GitHub issueThank you very much for developing this library that is so useful ,I’ve used it in a formal project.
Now, I have a question,how to set authentication socks proxy on docker Selenium Grid?
I know of a Remote class,but I don’t know how to configure it
my code :
# coding=utf-8
import time
from seleniumwire import webdriver
chrome_capabilities = {
"browserName": "chrome",
"version": "",
"platform": "ANY",
"javascriptEnabled": True,
'applicationName': 'test1'
}
sw_options = {
'addr': '0.0.0.0',
'port': 8087,
'auto_config': False, # Ensure this is set to False
'proxy': {
'http': 'socks5://user:pass@proxy_ip:proxy_port',
'https': 'socks5://user:pass@proxy_ip:proxy_port'
}
}
# browser = webdriver.Remote("http://docker_ip:docker_host/wd/hub", desired_capabilities=chrome_capabilities)
browser = webdriver.Remote("http://docker_ip:docker_host/wd/hub", desired_capabilities=chrome_capabilities,
seleniumwire_options=sw_options)
browser.get("http://httpbin.org/get")
print(browser.title)
time.sleep(60)
browser.get_screenshot_as_file("8.png")
browser.quit()
it still shows the IP of the real machine and not proxy ip
I try this config:issue220,maybe he used Kubernetes ,and I use doker,so I guess it’s a little different
I have been afraid of confusing you with unclear expressions, so I’m sorry that I edited it for several times
Looking forward to your reply
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
How to configure special proxy settings for a remote selenium ...
1 Answer 1 · Remove the user/pass from the socks proxy config and add them to your Proxy connection uri. · Use the...
Read more >HTTP Proxy Authentication with Selenium Webdriver - Tools QA
How to set HTTP Proxy with Username and Password · Type 'about:config' on the browser and press Enter. · The moment you press...
Read more >How to set proxy in Selenium : Tutorial | BrowserStack
The best way to integrate authenticated proxies with Selenium is by using PhantomJS as a headless browser instead of the Chrome WebDriver.
Read more >[Code example]-Set proxy.socks.port selenium - appsloveworld
Lets understand first, how FF (or webdriver you use with Selenium) is setting SOCKS proxy. For Firefox, do about:config in URL box. network.proxy.socks;10.10....
Read more >How to Setup Selenium Grid with BrowserMob-Proxy to pass ...
VP at JPMorgan Chase & Co. · Create docker-compose to run Selenium Grid · Implement BrowserMob-Proxy embedded solution to manipulate selenium http ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks,Let me try again how to configure it,by the way,this library is really good to use
When I use the real ip 192.168.0.xxx instead of 127.0.0.1 or 0.0.0.0, it works for me.