0

I am trying to find a solution to run my complete python script through a proxy. But I only find resoulutions with the request function, but that dont help in my case..

I've tried the following:

    import os
    
    proxy = 'http://<proxy>:<port>'
    
    os.environ['http_proxy'] = proxy 
    os.environ['HTTP_PROXY'] = proxy
    os.environ['https_proxy'] = proxy
    os.environ['HTTPS_PROXY'] = proxy
    
#Geckodriver Pfad
driver = webdriver.Firefox(executable_path=r'<path>')

url = 'https://www.dein-ip-check.de/'
driver.get(url)

text = driver.find_element_by_id('ipv4hostname').text
print(text)

time.sleep(2)

But it didnt worked.. It showes my home IP, not the proxy

Does anyone have a solution for this? :) Thank you very much!

Kowalski5
  • 1
  • 1

0 Answers0