Checking your browser before accessing message while accessing an application using ChromeDriver and Chrome using Selenium

I am trying to automate a certain type of routine and it was going all well until the website started performing the "Checking browser..." process (snapshot below). Strangely, it didn't do it during previous runs.

I have tried the following code, which I "stole" from this answer: Selenium stuck on “Checking your browser before accessing URL”, but my browser is still unresponsive:

url= "URL"
options = webdriver.ChromeOptions()
options.add_argument("--disable-blink-features=AutomationControlled")
driver_new = webdriver.Chrome(executable_path = "C:\webdrivers\chromedriver.exe", options = options)
driver_new.get(url)

Asked By: Kamran Abbasov
||

Answer #1:

This error message...

...implies that the Cloudflare have detected your requests to the website as an automated bot and subsequently denying you the access to the application.


Solution

In these cases the a potential solution would be to use the undetected-chromedriver to initialize the Chrome Browsing Context.

undetected-chromedriver is an optimized Selenium Chromedriver patch which does not trigger anti-bot services like Distill Network / Imperva / DataDome / Botprotect.io. It automatically downloads the driver binary and patches it.

  • Code Block:

    import undetected_chromedriver as uc
    from selenium import webdriver
    
    options = webdriver.ChromeOptions() 
    options.add_argument("start-maximized")
    driver = uc.Chrome(options=options)
    driver.get('https://bet365.com')
    

References

You can find a couple of relevant detailed discussions in:

Answered By: DebanjanB

Answer #2:

You can use time.sleep(6) That should be enough if you are redirected after 5 seconds.

Answered By: Gaj Julije
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .



# More Articles