omkarcloud / botasaurus-proxy-authentication

Proxy Server with support for SSL, proxy authentication and upstream proxy.
https://www.omkar.cloud/
MIT License
9 stars 2 forks source link

Proxy Fails to Work with Remote Webdrivers #1

Closed Aduomas closed 4 months ago

Aduomas commented 10 months ago

the following snippet works with local webdriver, however, it does not work with remote webdriver.

when used with Remote.Webdriver the following error gets raised: selenium.common.exceptions.WebDriverException: Message: unknown error: net::ERR_PROXY_CONNECTION_FAILED


class Crawler:
    def __init__(self, proxy_url, remote_url):
        self.proxy = proxy_url

        self.chrome_options = Options()
        add_proxy_options(self.chrome_options, self.proxy)

        if remote_url:
            self.driver = webdriver.Remote(
                command_executor=remote_url, options=self.chrome_options
            )
        else:
            self.driver = webdriver.Chrome(options=self.chrome_options)

    def crawl(self, url):
        self.driver.get(url)
        print("Current URL:", self.driver.current_url)
        return self.driver.page_source

    def close(self):
        self.driver.quit()
Chetan11-dev commented 4 months ago

We support local driver only