0

I tried to find a solution in this site but all the sripts don't work. I use the proxies of https://hidemy.name/en/proxy-list/ . I ask help to do this script.

from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType
import time

proxy_ip_port = '172.67.179.58:80'
proxy = Proxy()
proxy.proxy_type = ProxyType.MANUAL
proxy.http_proxy = proxy_ip_port
proxy.ssl_proxy = proxy_ip_port

capabilities = webdriver.DesiredCapabilities.CHROME
proxy.add_to_capabilities(capabilities)
driver = webdriver.Chrome('/tmp/chromedriver', desired_capabilities=capabilities)
driver.get('https://www.mio-ip.it/')
time.sleep(8)
driver.quit()

I tried this script but don't work

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

0

Using you can set the using the --proxy-server argument as follows:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service

proxy_ip_port = '172.67.179.58:80'
options = Options()
options.add_argument('--proxy-server=%s' % proxy_ip_port)
s = Service('C:\\BrowserDrivers\\chromedriver.exe')
driver = webdriver.Chrome(service=s, options=options)
driver.get('https://www.iplocation.net/')
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352