How to use authenticated proxy in selenium chromedriver?

前端 未结 7 861
挽巷
挽巷 2020-12-14 08:10

After searching for many hours I am starting to think this is impossible.

I need to run Chrome through selenium using different authenticated (not public) proxy\'s f

7条回答
  •  感情败类
    2020-12-14 08:40

    I could not find any solution for chrome. We can not add extensions with headless option. I am using Heroku with chrome-buildpack. There are following options

    1. Use xvfb instead of headless options and install extension
    2. Use local proxy forwarder that forwards traffic to authenticated proxy; we can use Squid, mitProxy, or something like proxy-login-automator

    Instead of these workaround I switched to Firefox where i was able to fill Username and Password on Proxy authentication Pop-up. Like given below. Following code is for Ruby using Capybara. You should be able to do something like this on your platform

    
    page.driver.browser.switch_to.alert.send_keys('proxy-username' + Selenium::WebDriver::Keys::KEYS[:tab] + 'my-password')
    page.driver.browser.switch_to.alert.accept
    

提交回复
热议问题