I tried to write a script to open chrome with authentication proxys, using selenium-wire. If I start the script, it stops immediately. No error code shows up but also no chrome (window) starts. What is the error/mistake I made. How can I fix it? My code is following:
import time
# Pfad zur Textdatei mit den Proxy-Daten
proxy_file_path = '/Pfad/zur/Datei/proxy.txt' # Passe den Pfad an
# Lese die Proxy-Daten aus der Textdatei
with open(proxy_file_path, 'r') as proxy_file:
proxy_lines = proxy_file.readlines()
# Iteriere durch die Proxy-Daten und verwende sie nacheinander
for line in proxy_lines:
line = line.strip()
if line:
parts = line.split('@')
if len(parts) == 2:
proxy = {
'https': f'https://{parts[0]}',
'http': f'http://{parts[0]}',
'no_proxy': 'localhost,127.0.0.1'
}
# Konfiguriere die Proxy-Optionen
options = {
'proxy': proxy
}
# Initialisiere den WebDriver mit den Proxy-Optionen
driver = webdriver.Chrome(seleniumwire_options=options)
driver.get('http://whatismyipaddress.com')
time.sleep(7)
# Schließe den Browser
driver.quit()```