Python undetected-chromebrowser suddenly not working on bet365.com

Viewed 2951

While using selenium for python to scrape bet365, I learned that I needed to use (successfully) undetected-chromedriver

This code worked like a charm up until just a few days ago

import undetected_chromedriver as uc
driver = uc.Chrome()
driver.get('https://bet365.com')

Now, however, when using this I get this in my browser

enter image description here

and my page is never returned.

Recently chrome appears to have updated me to version 87 so I tried downloading and using the newest chromedriver that is recommended for my version of chrome. This did not change matters.

I then decided to revert back to my previous version of chrome and use the chromedriver that corresponds to that version. This also did not change matters.

I have also tried to change my viewport and add a fake user agent. Still nothing.

I read somewhere to try this option

options=uc.ChromeOptions()
options.add_argument("--disable-backgrounding-occluded-windows")

but my issue was still unresolved.

So now I'm here asking: is there is anything I can do to successfully pull up bet365.com using undetected_chromedriver?

NOTE: this is not related to Chrome driver for Selenium stuck in grey screen on bet365 site

3 Answers

Same issue for me. You may try to custom the chromedriver and specify a proxy.

undetected_chromedriver.install(
    executable_path='c:/users/user1/chromedriver.exe',
)

opts = uc.ChromeOptions()
opts.add_argument(f'--proxy-server=socks5://127.0.0.1:9050')

So late last night I stumbled on the solution. Thankfully using undetected-chromedriver still works provided you modify the actual chromedriver.exe file. I didn't even know you could edit an exe file but I simply opened it in Notepad++ (it looks like scrambled gobbily gook) and did a find and replace

cdc_ to xyz_

This did the trick for me.

You can solve this issue with this

import undetected_chromedriver.v2 as uc
driver = uc.Chrome()
driver.get('https://bet365.com')
Related