5

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

user2412672
  • 1,459
  • 3
  • 20
  • 36
Matt Cremeens
  • 4,951
  • 7
  • 38
  • 67
  • This is not a duplicate as it was that post originally that led me to using `undetected-chromedriver` in the first place. That actually resolved my issue originally. I feel like something else is going on but I don't know what it is. Also note that I'm not getting a grey screen, but a white one. – Matt Cremeens Nov 29 '20 at 17:10
  • Exactly! Stop marking it as duplicate. Same happened here: https://stackoverflow.com/questions/65053339/bet365-detects-selenium-chromedriver – user2412672 Nov 29 '20 at 17:16
  • I'm amazed by how quickly it is to render a question as a duplicate. Surely it's too easy to close questions. Please re-open. – Matt Cremeens Nov 29 '20 at 17:20
  • @MattCremeens Moving forward if you feel your dup-closed question wasn't a duplicate, once you edit the question you need to add the username appending the `@` sign, so the user who closed the question is notified. I've reopened the question as mistakenly I have dup marked it earlier. – undetected Selenium Nov 29 '20 at 17:24
  • 1
    OK @DebanjanB. Thanks. For some reason the name of the closer didn't appear for me, but maybe I just missed it. Thanks for re-opening. – Matt Cremeens Nov 29 '20 at 17:26
  • this question really helped me, where can I find how ```undetected_chromedriver ``` works? – coderoftheday Nov 29 '20 at 18:29
  • @coderoftheday click on the link in the question or go here: https://github.com/ultrafunkamsterdam/undetected-chromedriver – Matt Cremeens Nov 29 '20 at 19:09

3 Answers3

2

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')
4b0
  • 21,981
  • 30
  • 95
  • 142
taza taza
  • 21
  • 1
1

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.

Matt Cremeens
  • 4,951
  • 7
  • 38
  • 67
1

You can solve this issue with this

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