Search code examples
pythongoogle-chromeselenium-webdriverselenium-chromedriver

How to update ChromeDriver binary file on Ubuntu


I am working with Python / Selenium / Chrome / ChromeDriver to do testing, scraping, etc. Actually trying to replace cdc_ string with something else. When I opened file using vim and replace cdc_ string with cat_ nothing has changed. I do believe, I must rebuild it again. How can I rebuild this file ? Any ideas ?

As a reference, I am using this thread.

sudo vim -b /home/chromedriver

Then I replace cdc_ with cat_ and save file. When I executed Selenium again, cdc_ was still available in the console.

Any ideas ?


Solution

  • Assuming your goal is to remove these cdc_ items from Chrome that appear when using chromedriver...

    "cdc_" in the Devtools console

    ...then that's what SeleniumBase UC Mode is for.

    After pip install seleniumbase, you can run seleniumbase scripts that bypass CAPTCHAs, such as:

    from seleniumbase import Driver
    
    driver = Driver(uc=True)
    driver.uc_open_with_reconnect("https://top.gg/", 5)
    driver.quit()
    

    Or:

    from seleniumbase import SB
    
    with SB(uc=True) as sb:
        sb.driver.uc_open_with_reconnect("https://top.gg/", 5)
    

    SeleniumBase UC Mode is just one of many available modes of the SeleniumBase framework that extends Selenium/WebDriver with a lot more abilities and improvements.