wkeeling / selenium-wire

Extends Selenium's Python bindings to give you the ability to inspect requests made by the browser.
MIT License
1.9k stars 251 forks source link

seleniumwire and undetected_chromedriver #636

Open Donato360 opened 1 year ago

Donato360 commented 1 year ago

I have python 3.9 installed in a virtual environment.

My virtual environment contains the following libraries:

seleniumwire
undetected_chromedriver

I have also installed the certificate ca.ctr in my virtual environment root using the command:

python3 -m seleniumwire extractcert

In the root I have a script that try to access a website e.g. https://www.google.com/

Here my code:

import seleniumwire.undetected_chromedriver as uc

options = { 'ca_cert': '/ca.crt' }

chrome_options = uc.ChromeOptions()

driver = uc.Chrome( options=chrome_options, seleniumwire_options=options )

url = "https://www.google.com/"

driver.get(self.url)

I get the following error when running the script:

line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

Please note I am trying to make this work on a virtual environment installed on a Mac. thank you for your help

Chetan11-dev commented 9 months ago

Botasaurus Framework supports SSL with authenticated proxy sych as http://username:password@proxy-provider-domain:port.

seleniumwire-vs-botasaurus

Installation

pip install botasaurus

Example

from botasaurus import *

@browser(proxy="http://username:password@proxy-provider-domain:port") # TODO: Replace with your own proxy 
def visit_ipinfo(driver: AntiDetectDriver, data):
    driver.get("https://ipinfo.io/")
    driver.prompt()

visit_ipinfo()

You can learn about Botasaurus Here.