Zum Inhalt springen
GProxy
Registrierung
Гайды 11 Min. Lesezeit 27 Aufrufe

Selenium Proxy-Einrichtung

Dieser Leitfaden beschreibt, wie man Proxies für Selenium mit Python, Java und C# einrichtet und konfiguriert. Nutzen Sie GProxy für robuste Lösungen.

Python Браузер
Selenium Proxy-Einrichtung

Die Einrichtung eines Selenium-Proxys beinhaltet die Konfiguration von Browseroptionen oder -fähigkeiten, um den Webverkehr über einen bestimmten Proxyserver zu leiten. Dies ermöglicht Aufgaben wie Geo-Unblocking, Anonymität und die Inspektion des Netzwerkverkehrs. Diese Konfiguration ist unerlässlich für die Automatisierung von Aufgaben, die das Umgehen geografischer Beschränkungen, das Testen des Website-Verhaltens von verschiedenen Netzwerkstandorten aus oder die Verwaltung des Netzwerkverkehrs während Tests oder der Datenextraktion erfordern.

Die Verwendung eines Proxys mit Selenium ermöglicht die Umleitung des gesamten Browser-Traffics über einen Vermittlungsserver. Diese Fähigkeit ist entscheidend für:
* Das Umgehen geografischer Inhaltsbeschränkungen.
* Die Wahrung der Anonymität bei automatisierten Web-Interaktionen.
* Das Testen der Leistung oder des Verhaltens einer Website, wenn sie von verschiedenen Netzwerkpunkten aus aufgerufen wird.
* Das Überwachen oder Debuggen von Netzwerkanfragen und -antworten.
* Den Zugriff auf interne oder eingeschränkte Netzwerke.

Allgemeine Proxy-Konzepte

Bevor Sie Selenium konfigurieren, ist es entscheidend, grundlegende Proxy-Konzepte zu verstehen.

Proxy-Typen

  • HTTP/HTTPS-Proxys: Diese Proxys arbeiten auf der Anwendungsschicht (Layer 7). HTTP-Proxys verarbeiten unverschlüsselten HTTP-Verkehr, während HTTPS-Proxys verschlüsselten HTTPS-Verkehr verarbeiten. Viele HTTPS-Proxys führen eine SSL-Abfangung (Man-in-the-Middle) durch, entschlüsseln den Verkehr, inspizieren ihn und verschlüsseln ihn dann erneut, bevor sie ihn weiterleiten. Dies kann manchmal zu SSL-Zertifikatsfehlern führen, wenn das Zertifikat des Proxys vom Browser nicht als vertrauenswürdig eingestuft wird.
  • SOCKS-Proxys (SOCKS4, SOCKS5): SOCKS (Socket Secure)-Proxys arbeiten auf einer niedrigeren Ebene (Layer 5). Sie sind protokollunabhängig, was bedeutet, dass sie jede Art von TCP/UDP-Verkehr verarbeiten können, nicht nur HTTP/HTTPS. SOCKS5 ist die gängigere Version, die Authentifizierung und UDP-Verkehr unterstützt, was sie vielseitig für verschiedene Anwendungen jenseits des Webbrowsings macht.

Proxy-Authentifizierung

Viele Proxyserver erfordern eine Authentifizierung (Benutzername und Passwort), um den Zugriff zu gewähren. Selenium handhabt die grundlegende Authentifizierung, indem es die Anmeldeinformationen direkt in den Proxy-String einbettet, typischerweise im Format username:password@host:port.

Browseroptionen/-fähigkeiten

Selenium interagiert mit Webbrowsern über spezifische Treiber-Executables (z.B. ChromeDriver für Chrome, GeckoDriver für Firefox). Diese Treiber akzeptieren ein Options-Objekt (z.B. ChromeOptions, FirefoxOptions), in dem die Proxy-Einstellungen definiert werden. Diese Einstellungen werden beim Start an den Browser übergeben, wodurch sichergestellt wird, dass der gesamte nachfolgende Verkehr dieser Browserinstanz über den angegebenen Proxy geleitet wird.

Selenium Proxy-Einrichtung: Sprachspezifische Beispiele

Die folgenden Abschnitte beschreiben, wie Proxys für Chrome und Firefox mit Python, Java und C# konfiguriert werden. Die Prinzipien sind auf andere von Selenium unterstützte Browser, wie Edge oder Safari, übertragbar, indem deren jeweilige Options-Objekte verwendet werden.

Python

Python nutzt selenium.webdriver.Proxy und ProxyType, um Proxy-Konfigurationen innerhalb der Browseroptionen zu definieren.

Grundlegender HTTP/HTTPS-Proxy

from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.firefox.options import Options as FirefoxOptions

# Proxy settings
PROXY_HOST = "your_proxy_host"
PROXY_PORT = 8080 # Or 443 for HTTPS

# --- Chrome Example ---
chrome_options = ChromeOptions()
chrome_options.add_argument(f'--proxy-server={PROXY_HOST}:{PROXY_PORT}')

# Optional: Disable SSL certificate checks if proxy causes issues (use with caution)
# chrome_options.add_argument('--ignore-certificate-errors')

driver_chrome = webdriver.Chrome(options=chrome_options)
driver_chrome.get("http://www.example.com")
# ... perform actions ...
driver_chrome.quit()

# --- Firefox Example ---
firefox_options = FirefoxOptions()
firefox_options.set_preference("network.proxy.type", 1) # Manual proxy configuration
firefox_options.set_preference("network.proxy.http", PROXY_HOST)
firefox_options.set_preference("network.proxy.http_port", PROXY_PORT)
firefox_options.set_preference("network.proxy.ssl", PROXY_HOST)
firefox_options.set_preference("network.proxy.ssl_port", PROXY_PORT)
firefox_options.set_preference("network.proxy.no_proxies_on", "") # Ensure proxy is used for all hosts

driver_firefox = webdriver.Firefox(options=firefox_options)
driver_firefox.get("http://www.example.com")
# ... perform actions ...
driver_firefox.quit()

Authentifizierter HTTP/HTTPS-Proxy

Für authentifizierte HTTP/HTTPS-Proxys betten Sie die Anmeldeinformationen direkt in den Proxy-String ein.

from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.firefox.options import Options as FirefoxOptions

PROXY_HOST = "your_proxy_host"
PROXY_PORT = 8080
PROXY_USER = "your_username"
PROXY_PASS = "your_password"

# --- Chrome Example ---
# Format: user:pass@host:port
authenticated_proxy = f"{PROXY_USER}:{PROXY_PASS}@{PROXY_HOST}:{PROXY_PORT}"
chrome_options = ChromeOptions()
chrome_options.add_argument(f'--proxy-server={authenticated_proxy}')

driver_chrome = webdriver.Chrome(options=chrome_options)
driver_chrome.get("http://www.example.com")
driver_chrome.quit()

# --- Firefox Example ---
# Firefox's native preferences do not directly support username/password in the proxy string
# for HTTP/HTTPS. A common workaround is to use a browser extension or a proxy manager.
# However, if using the "direct" proxy option through the capabilities (which is less common for Firefox
# compared to Chrome's --proxy-server argument), it might work.
# For robust Firefox authenticated proxy, consider using a proxy extension or a SOCKS5 proxy.
# The following is a general approach that might not work for all HTTP/HTTPS authenticated proxies in Firefox directly.
# For simplicity and cross-browser consistency, consider using SOCKS5 if authentication is a must.

# The standard Firefox preferences do not directly support embedding user:pass for HTTP/HTTPS.
# For authenticated HTTP/HTTPS proxies in Firefox, the browser typically prompts for credentials.
# WebDriver cannot interact with these native browser authentication prompts directly.
# A common solution is to use a proxy that supports authentication via the URL (like some SOCKS5 proxies)
# or to use a browser extension that handles proxy authentication.
# For this example, we'll omit a direct Firefox authenticated HTTP/HTTPS proxy setup due to complexity
# and lack of direct WebDriver support for native browser authentication prompts.

SOCKS-Proxy

SOCKS-Proxys erfordern die Angabe der SOCKS-Version. SOCKS5 wird aufgrund seiner Funktionen im Allgemeinen bevorzugt.

from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.firefox.options import Options as FirefoxOptions

PROXY_HOST = "your_socks_proxy_host"
PROXY_PORT = 1080 # Common SOCKS port
PROXY_USER = "your_username" # Optional for SOCKS5
PROXY_PASS = "your_password" # Optional for SOCKS5

# --- Chrome Example ---
chrome_options = ChromeOptions()
# For SOCKS5 with authentication, format is socks5://user:pass@host:port
# For SOCKS5 without authentication, format is socks5://host:port
# For SOCKS4, use socks4://host:port
socks_proxy_string = f"socks5://{PROXY_USER}:{PROXY_PASS}@{PROXY_HOST}:{PROXY_PORT}" if PROXY_USER else f"socks5://{PROXY_HOST}:{PROXY_PORT}"
chrome_options.add_argument(f'--proxy-server={socks_proxy_string}')

driver_chrome = webdriver.Chrome(options=chrome_options)
driver_chrome.get("http://www.example.com")
driver_chrome.quit()

# --- Firefox Example ---
firefox_options = FirefoxOptions()
firefox_options.set_preference("network.proxy.type", 1) # Manual proxy configuration
firefox_options.set_preference("network.proxy.socks", PROXY_HOST)
firefox_options.set_preference("network.proxy.socks_port", PROXY_PORT)
firefox_options.set_preference("network.proxy.socks_version", 5) # For SOCKS5
firefox_options.set_preference("network.proxy.socks_username", PROXY_USER) # For authenticated SOCKS5
firefox_options.set_preference("network.proxy.socks_password", PROXY_PASS) # For authenticated SOCKS5
firefox_options.set_preference("network.proxy.no_proxies_on", "")

driver_firefox = webdriver.Firefox(options=firefox_options)
driver_firefox.get("http://www.example.com")
driver_firefox.quit()

Java

Java verwendet die Klasse org.openqa.selenium.Proxy und setzt diese innerhalb der Fähigkeiten des Browser-Treibers.

Grundlegender HTTP/HTTPS-Proxy

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;

public class SeleniumProxySetup {

    public static void main(String[] args) {
        String PROXY_HOST = "your_proxy_host";
        int PROXY_PORT = 8080;

        // --- Chrome Example ---
        ChromeOptions chromeOptions = new ChromeOptions();
        Proxy proxyChrome = new Proxy();
        proxyChrome.setHttpProxy(PROXY_HOST + ":" + PROXY_PORT);
        proxyChrome.setSslProxy(PROXY_HOST + ":" + PROXY_PORT); // Also set for HTTPS
        chromeOptions.setCapability("proxy", proxyChrome);

        WebDriver driverChrome = new ChromeDriver(chromeOptions);
        driverChrome.get("http://www.example.com");
        // ... perform actions ...
        driverChrome.quit();

        // --- Firefox Example ---
        FirefoxOptions firefoxOptions = new FirefoxOptions();
        Proxy proxyFirefox = new Proxy();
        proxyFirefox.setHttpProxy(PROXY_HOST + ":" + PROXY_PORT);
        proxyFirefox.setSslProxy(PROXY_HOST + ":" + PROXY_PORT); // Also set for HTTPS
        firefoxOptions.setCapability("proxy", proxyFirefox);

        WebDriver driverFirefox = new FirefoxDriver(firefoxOptions);
        driverFirefox.get("http://www.example.com");
        // ... perform actions ...
        driverFirefox.quit();
    }
}

Authentifizierter HTTP/HTTPS-Proxy

Ähnlich wie bei Python werden für die grundlegende HTTP/HTTPS-Authentifizierung die Anmeldeinformationen in den Proxy-String eingebettet.

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
// Firefox example for authenticated HTTP/HTTPS is complex due to native prompts.
// Consider SOCKS5 or a browser extension for Firefox authentication.

public class SeleniumAuthenticatedProxySetup {

    public static void main(String[] args) {
        String PROXY_HOST = "your_proxy_host";
        int PROXY_PORT = 8080;
        String PROXY_USER = "your_username";
        String PROXY_PASS = "your_password";

        // --- Chrome Example ---
        ChromeOptions chromeOptions = new ChromeOptions();
        Proxy proxyChrome = new Proxy();
        // Format: user:pass@host:port
        String authenticatedProxyString = PROXY_USER + ":" + PROXY_PASS + "@" + PROXY_HOST + ":" + PROXY_PORT;
        proxyChrome.setHttpProxy(authenticatedProxyString);
        proxyChrome.setSslProxy(authenticatedProxyString); // Also set for HTTPS
        chromeOptions.setCapability("proxy", proxyChrome);

        WebDriver driverChrome = new ChromeDriver(chromeOptions);
        driverChrome.get("http://www.example.com");
        driverChrome.quit();

        // --- Firefox Example ---
        // As noted in Python, Firefox's native preferences do not directly support
        // embedding username/password for HTTP/HTTPS proxies via WebDriver capabilities
        // without a browser extension. The browser typically prompts for credentials.
        // For robust Firefox authenticated proxy, consider using a SOCKS5 proxy or a proxy extension.
    }
}

SOCKS-Proxy

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;

public class SeleniumSocksProxySetup {

    public static void main(String[] args) {
        String PROXY_HOST = "your_socks_proxy_host";
        int PROXY_PORT = 1080; // Common SOCKS port
        String PROXY_USER = "your_username"; // Optional for SOCKS5
        String PROXY_PASS = "your_password"; // Optional for SOCKS5

        // --- Chrome Example ---
        ChromeOptions chromeOptions = new ChromeOptions();
        Proxy proxyChrome = new Proxy();
        // For SOCKS5 with authentication, format is socks5://user:pass@host:port
        // For SOCKS5 without authentication, format is socks5://host:port
        String socksProxyString = PROXY_USER != null && !PROXY_USER.isEmpty()
                                ? "socks5://" + PROXY_USER + ":" + PROXY_PASS + "@" + PROXY_HOST + ":" + PROXY_PORT
                                : "socks5://" + PROXY_HOST + ":" + PROXY_PORT;
        chromeOptions.addArguments("--proxy-server=" + socksProxyString); // Chrome uses --proxy-server argument for SOCKS

        WebDriver driverChrome = new ChromeDriver(chromeOptions);
        driverChrome.get("http://www.example.com");
        driverChrome.quit();

        // --- Firefox Example ---
        FirefoxOptions firefoxOptions = new FirefoxOptions();
        Proxy proxyFirefox = new Proxy();
        proxyFirefox.setSocksProxy(PROXY_HOST + ":" + PROXY_PORT);
        proxyFirefox.setSocksVersion(5); // For SOCKS5
        // Firefox preferences for SOCKS authentication
        firefoxOptions.setPreference("network.proxy.socks_username", PROXY_USER);
        firefoxOptions.setPreference("network.proxy.socks_password", PROXY_PASS);
        firefoxOptions.setCapability("proxy", proxyFirefox);

        WebDriver driverFirefox = new FirefoxDriver(firefoxOptions);
        driverFirefox.get("http://www.example.com");
        driverFirefox.quit();
    }
}

C

C# verwendet die Klasse OpenQA.Selenium.Proxy und setzt diese innerhalb der Browseroptionen.

Grundlegender HTTP/HTTPS-Proxy

using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;

public class SeleniumProxySetup
{
    public static void Main(string[] args)
    {
        string PROXY_HOST = "your_proxy_host";
        int PROXY_PORT = 8080;

        // --- Chrome Example ---
        ChromeOptions chromeOptions = new ChromeOptions();
        Proxy proxyChrome = new Proxy();
        proxyChrome.HttpProxy = $"{PROXY_HOST}:{PROXY_PORT}";
        proxyChrome.SslProxy = $"{PROXY_HOST}:{PROXY_PORT}"; // Also set for HTTPS
        chromeOptions.Proxy = proxyChrome;

        IWebDriver driverChrome = new ChromeDriver(chromeOptions);
        driverChrome.Navigate().GoToUrl("http://www.example.com");
        // ... perform actions ...
        driverChrome.Quit();

        // --- Firefox Example ---
        FirefoxOptions firefoxOptions = new FirefoxOptions();
        Proxy proxyFirefox = new Proxy();
        proxyFirefox.HttpProxy = $"{PROXY_HOST}:{PROXY_PORT}";
        proxyFirefox.SslProxy = $"{PROXY_HOST}:{PROXY_PORT}"; // Also set for HTTPS
        firefoxOptions.Proxy = proxyFirefox;

        IWebDriver driverFirefox = new FirefoxDriver(firefoxOptions);
        driverFirefox.Navigate().GoToUrl("http://www.example.com");
        // ... perform actions ...
        driverFirefox.Quit();
    }
}

Authentifizierter HTTP/HTTPS-Proxy

Für die grundlegende Authentifizierung betten Sie die Anmeldeinformationen in den Proxy-String ein.

using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
// Firefox example for authenticated HTTP/HTTPS is complex due to native prompts.
// Consider SOCKS5 or a browser extension for Firefox authentication.

public class SeleniumAuthenticatedProxySetup
{
    public static void Main(string[] args)
    {
        string PROXY_HOST = "your_proxy_host";
        int PROXY_PORT = 8080;
        string PROXY_USER = "your_username";
        string PROXY_PASS = "your_password";

        // --- Chrome Example ---
        ChromeOptions chromeOptions = new ChromeOptions();
        Proxy proxyChrome = new Proxy();
        // Format: user:pass@host:port
        string authenticatedProxyString = $"{PROXY_USER}:{PROXY_PASS}@{PROXY_HOST}:{PROXY_PORT}";
        proxyChrome.HttpProxy = authenticatedProxyString;
        proxyChrome.SslProxy = authenticatedProxyString; // Also set for HTTPS
        chromeOptions.Proxy = proxyChrome;

        IWebDriver driverChrome = new ChromeDriver(chromeOptions);
        driverChrome.Navigate().GoToUrl("http://www.example.com");
        driverChrome.Quit();

        // --- Firefox Example ---
        // As noted in Python and Java, Firefox's native preferences do not directly support
        // embedding username/password for HTTP/HTTPS proxies via WebDriver capabilities
        // without a browser extension. The browser typically prompts for credentials.
        // For robust Firefox authenticated proxy, consider using a SOCKS5 proxy or a proxy extension.
    }
}

SOCKS-Proxy

using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;

public class SeleniumSocksProxySetup
{
    public static void Main(string[] args)
    {
        string PROXY_HOST = "your_socks_proxy_host";
        int PROXY_PORT = 1080; // Common SOCKS port
        string PROXY_USER = "your_username"; // Optional for SOCKS5
        string PROXY_PASS = "your_password"; // Optional for SOCKS5

        // --- Chrome Example ---
        ChromeOptions chromeOptions = new ChromeOptions();
        // Chrome uses --proxy-server argument for SOCKS.
        // For SOCKS5 with authentication, format is socks5://user:pass@host:port
        // For SOCKS5 without authentication, format is socks5://host:port
        string socksProxyString = string.IsNullOrEmpty(PROXY_USER)
                                ? $"socks5://{PROXY_HOST}:{PROXY_PORT}"
                                : $"socks5://{PROXY_USER}:{PROXY_PASS}@{PROXY_HOST}:{PROXY_PORT}";
        chromeOptions.AddArgument($"--proxy-server={socksProxyString}");

        IWebDriver driverChrome = new ChromeDriver(chromeOptions);
        driverChrome.Navigate().GoToUrl("http://www.example.com");
        driverChrome.Quit();

        // --- Firefox Example ---
        FirefoxOptions firefoxOptions = new FirefoxOptions();
        Proxy proxyFirefox = new Proxy();
        proxyFirefox.SocksProxy = $"{PROXY_HOST}:{PROXY_PORT}";
        proxyFirefox.SocksVersion = 5; // For SOCKS5
        // Firefox preferences for SOCKS authentication
        firefoxOptions.SetPreference("network.proxy.socks_username", PROXY_USER);
        firefoxOptions.SetPreference("network.proxy.socks_password", PROXY_PASS);
        firefoxOptions.Proxy = proxyFirefox;

        IWebDriver driverFirefox = new FirefoxDriver(firefoxOptions);
        driverFirefox.Navigate().GoToUrl("http://www.example.com");
        driverFirefox.Quit();
    }
}

Vergleich der Proxy-Typen

Funktion HTTP-Proxy HTTPS-Proxy SOCKS-Proxy (SOCKS5)
Protokollschicht Anwendung (Schicht 7) Anwendung (Schicht 7) Sitzung (Schicht 5)
Verarbeiteter Verkehr Nur HTTP-Verkehr Nur verschlüsselter HTTP (HTTPS)-Verkehr Jeder TCP/UDP-Verkehr
Verschlüsselung Keine (Client-zu-Proxy) Client-zu-Proxy (kann neu verschlüsseln) Keine (Client-zu-Proxy), anwendungseigene Verschlüsselung funktioniert weiterhin
Anonymität Kann ursprüngliche IP in Headern offenbaren Besser, aber immer noch ein Proxy Hoch, protokollunabhängiger, weniger Header-Manipulation
Authentifizierung Basic, Digest (über Header) Basic, Digest (über Header) Benutzername/Passwort, GSS-API
Anwendungsfall Einfaches Webbrowsing, Caching, Inhaltsfilterung Sicheres Webbrowsing, sensible Daten, SSL-Inspektion Allzweck, P2P, Gaming, VPN-ähnliche Funktionalität
Leistung Im Allgemeinen schneller für HTTP Overhead für Verschlüsselung/Entschlüsselung Kann aufgrund der Low-Level-Verarbeitung langsamer sein

Häufige Probleme und Fehlerbehebung

  • Proxy funktioniert nicht: Überprüfen Sie den Proxy-Host und den Port. Stellen Sie sicher, dass der Proxyserver online und von der Maschine, auf der Selenium läuft, erreichbar ist. Firewall-Regeln könnten Verbindungen zum Proxy blockieren.
  • Authentifizierungsfehler: Überprüfen Sie Benutzername und Passwort. Bestätigen Sie, dass der Proxy die von Selenium verwendete Authentifizierungsmethode (typischerweise grundlegende Authentifizierung über URL-Einbettung) unterstützt.
  • SSL-Zertifikatsfehler: Wenn ein HTTPS-Proxy eine SSL-Abfangung durchführt, kann der Browser Zertifikatswarnungen melden, da er das dynamisch generierte Zertifikat des Proxys nicht als vertrauenswürdig einstuft. Optionen umfassen:
    • Deaktivieren der Zertifikatsvalidierung (z.B. --ignore-certificate-errors für Chrome), dies ist jedoch ein Sicherheitsrisiko und nicht für die Produktion empfohlen.
    • Installation des Root-Zertifikats des Proxys in den Vertrauensspeicher des Browsers.
  • Timeout-Fehler: Der Proxyserver könnte langsam, überlastet sein oder Netzwerkprobleme haben. Erhöhen Sie die impliziten oder expliziten Wartezeiten von Selenium oder testen Sie mit einem anderen Proxy.
  • Browserspezifische Eigenheiten: Obwohl der allgemeine Ansatz konsistent ist, gibt es geringfügige Unterschiede in der Art und Weise, wie jeder Browser-Treiber Proxy-Einstellungen handhabt. Schlagen Sie bei unerwartetem Verhalten in der browserspezifischen Dokumentation nach.

Best Practices

  • Umgebungsvariablen für Anmeldeinformationen: Vermeiden Sie es, sensible Proxy-Benutzernamen und Passwörter direkt im Skript fest zu codieren. Rufen Sie diese stattdessen aus Umgebungsvariablen oder einem sicheren Konfigurationsverwaltungssystem ab.
  • Dedizierter Proxy-Manager: Für komplexe Szenarien, wie rotierende Proxys, die Verwaltung großer Proxy-Listen oder die Implementierung fortgeschrittener Proxy-Logik, sollten Sie die Verwendung einer dedizierten Proxy-Manager-Bibliothek oder eines SDK eines kommerziellen Proxy-Dienstes in Betracht ziehen.
  • Fehlerbehandlung: Implementieren Sie robuste try-catch-Blöcke, um Proxy-Verbindungsfehler, Authentifizierungsfehler oder Netzwerk-Timeouts elegant zu behandeln.
  • Kompatibilität mit Headless-Modus: Proxy-Konfigurationen funktionieren nahtlos mit Headless-Browser-Modi, was für die serverseitige Automatisierung vorteilhaft ist.
Aktualisiert: 03.03.2026
Zurück zur Kategorie

Testen Sie unsere Proxys

20.000+ Proxys in über 100 Ländern weltweit

support_agent
GProxy Support
Usually replies within minutes
Hi there!
Send us a message and we'll reply as soon as possible.