ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
https://github.com/UltrafunkAmsterdam/undetected-chromedriver
GNU General Public License v3.0
9.71k stars 1.14k forks source link

chrome driver forces https #1846

Open Magicen0722 opened 5 months ago

Magicen0722 commented 5 months ago

What happened?

When I pass an URL to load a website, say, http://yoururl.com, it redirects to https://yoururl.com

options = ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument("--allow-running-insecure-content")
options.add_argument('--ignore-ssl-errors')
options.add_argument('--disable-web-security')
driver = Chrome(options=options,
                use_subprocess=True,
                driver_executable_path=DRIVER_PATH,
                )
driver.get('http://yoururl.com')

What caused it?

Caused by HTTP Strict Transport Security (aka HSTS),mentioned here It mentioned that you can visit chrome://net-internals/#hsts to unload HSTS preloading through the UI interface for the corresponding URL. At the same time, you can also exclude the corresponding URL in chrome://settings/content/insecureContent. But our service needs to be deployed to different servers or virtual machines, it should not be manual.

what i expected?

Is there a way to disable HSTS by using code? Or force the use of http protocol to access the specified URL?

Any help would be grateful!

rfracaroli-absolute commented 1 month ago

Any news on this?

Artjxm commented 1 month ago

I have the same issue and haven't come to a better solution than changing the url to desired (before redirect) in the delay of EC by hand (this works for my testing purposes).