Target website refuse selenium with Out of Memory Error. Python 3

Viewed 187

so this is kind of a race between this website and developers, because it happens from time to time.

I'm trying to load this website Bet365 in Chromedriver using Python3. Since the latest Chrome update to version 88 instead of loading the page as it did before, it just goes blank and throws the "Out of Memory" Error. Downgrading Chrome version doesn't work, and it is not a problem with the RAM. It is this website actively blocking the connection. Here is my script so far

url='https://www.bet365.com'
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument("window-size=1920,1080")
options.add_argument('log-level=3')

options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
browser=webdriver.Chrome(options=options,executable_path=r"chromedriver.exe")
        
browser.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
                              "source": """
                                Object.defineProperty(navigator, 'webdriver', {
                                  get: () => undefined
                                })
                              """
                            })
browser.execute_cdp_cmd('Network.setUserAgentOverride', 
                                {"userAgent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4183.53 Safari/537.36'})
        #Chrome/83.0.4103.53
browser.get(url)

It doesn't work neither headless nor headfull, and it also doesn't work changing the "cdc_" in the chromedriver script for "xyz_" or "dog_". How can this be fixed?

EDIT: This is the error codewise selenium is giving Picture

1 Answers

You also have to install the latet chromedriver for this particular version of chrome

Related