N
N
New_account2018-08-28 17:14:12
Python
New_account, 2018-08-28 17:14:12

selenium. How to set up a proxy or VPN in any browser?

Good day!!! I need to write a test using Selenium. The main problem is the proxy. At first conceived under Chrome. Google has a bunch of ways to set up a proxy for chrome. AND NONE WORK!!! Then I remembered the built-in VPN in Opera. Nothing works either. Now I'm considering an option for any browsers. Can someone give me some advice? Half a day of googling gave me nothing, my only salvation was a toaster. Help someone is not difficult.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Eremin, 2018-08-28
@EreminD

https://stackoverflow.com/questions/11450158/how-d...
?
Well, in general, in selenium itself it is installed like this:
https://www.seleniumhq.org/docs/04_webdriver_advan...

I
Ivan, 2018-08-28
@Iv_and_S

when setting up a VPN (well, there are all sorts of them), usually all traffic from your machine goes through VPN.
then you just use Webdriver whichever browser from Selenium is needed.
do not consider it for advertising, I used it for my needs., all the rules.
https://protonvpn.com/
the client set up in a couple of clicks. all traffic goes through VPN, just launch browsers and work.
operating system Ubuntu 16

I
IvanSstarr, 2019-10-15
@IvanSstarr

This is how it is written in Powershell, and in Python everything is the same:
add-type -path "C:\Program Files\WindowsPowerShell\Modules\Selenium\1.1\assemblies\WebDriver.dll"
$options = New-Object OpenQA.Selenium.Chrome .ChromeOptions
$options.addArguments("proxy-server= 5.196.132.124:3128 ")
$driver = New-Object OpenQA.Selenium.Chrome.ChromeDriver($options)
$Driver.Navigate().GoToUrl(" https:// 2ip.ru/ ")
Checked it works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question