R
R
rkfddf2020-04-29 17:52:43
Python
rkfddf, 2020-04-29 17:52:43

How to configure Selenium Chrome to work through a proxy?

I tried all the available scripts for working Selenium Chrome through a proxy and nothing happened - either the library is missing or some module. It seems to be connected and even there are no errors (except for the message in the browser - ERR_TUNNEL_CONNECTION_FAILED), but it does not work.
Tell me a working option, I work on Selenium Chromedriver, pyhton. Well, the simplest, only complete, proxy, of course, I will change to a fresh one.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Sundukov, 2020-04-29
@alekciy

Use free proxies taken from the Internet? I suspect so.
Use HTTPS addresses? I suspect so. I have such an example for puppeteer that works:

const puppeteer = require('puppeteer');

(async() => {
  const browser = await puppeteer.launch({
    arg: ['--ignore-certificate-errors', '--proxy-server=45.77.202.207:8080']
  }); 
  const page = await browser.newPage();

  await page.goto('https://ya.ru/'); 
  await page.emulateMedia('screen'); 
  await page.pdf({
    path: './page.pdf', 
    printBackground: true 
  });
await browser.close() ;
})();

When working with free proxies, you need to disable certificate verification and be prepared that most of the requests will fail for one reason or another. On a good note, such proxies need to be checked before use.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question