Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
Selenium-webdriver Proxy Authentication

Currently, I need to use proxy with authentication, on selenium-webdriver on Firefox.

I successfully connect to Tor using :

var option = new Options();
  option.headless()
  option.setPreference('network.proxy.type', 1)
  .setPreference('network.proxy.socks', '127.0.0.1')
  .setPreference('network.proxy.socks_port', 9050)
  .setPreference('network.proxy.socks_remote_dns', true)
  .setPreference('network.proxy.socks_version', 5)


  let driver = await new Builder()
  .forBrowser(Browser.FIREFOX)
  .setFirefoxOptions(option)
  .build();

But I don't find how to pass username and password for other proxy.

I looked on Selenium's github, but nothing worked. This is the exemple on the file's comment but not working:

let capabilities = new Capabilities();
  capabilities.setProxy(proxy.socks('username:pass@host:port'))
  // for tor
  capabilities.setProxy(proxy.socks('host:port'))

  let driver = await new Builder()
  .withCapabilities(capabilities)
  .forBrowser(Browser.FIREFOX)
  .setFirefoxOptions(option)
  .build();

Please help me :(

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!