2

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)

enter image description here

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
akkab
  • 401
  • 1
  • 6
  • 19

2 Answers2

2

This error message...

cloudflare

...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:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Unfortunately, it is still "Checking...", even with the code block that you have suggested. Could it be that the website, which I am trying to connect to has foreseen this? – akkab Dec 16 '20 at 13:29
  • 1
    @KamranAbbasov Possibly your _IP_ got blacklisted. Check the first reference link to whitelist your IP. – undetected Selenium Dec 16 '20 at 13:31
0

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

Tibebes. M
  • 6,940
  • 5
  • 15
  • 36
Gaj Julije
  • 1,538
  • 15
  • 32