Webdriver Google Chrome Error

Good evening everyone. While programming, I encountered an error with Google Chrome Webdriver:

INFO:WDM:====== WebDriver manager ======
/nix/store/7q1b1bsmxi91zci6g8714rcljl620y7f-bash-5.2-p15/bin/sh: line 1: google-chrome: command not found
/nix/store/7q1b1bsmxi91zci6g8714rcljl620y7f-bash-5.2-p15/bin/sh: line 1: google-chrome-stable: command not found
/nix/store/7q1b1bsmxi91zci6g8714rcljl620y7f-bash-5.2-p15/bin/sh: line 1: google-chrome-beta: command not found
/nix/store/7q1b1bsmxi91zci6g8714rcljl620y7f-bash-5.2-p15/bin/sh: line 1: google-chrome-dev: command not found
/nix/store/7q1b1bsmxi91zci6g8714rcljl620y7f-bash-5.2-p15/bin/sh: line 1: google-chrome: command not found
/nix/store/7q1b1bsmxi91zci6g8714rcljl620y7f-bash-5.2-p15/bin/sh: line 1: google-chrome-stable: command not found
/nix/store/7q1b1bsmxi91zci6g8714rcljl620y7f-bash-5.2-p15/bin/sh: line 1: google-chrome-beta: command not found
/nix/store/7q1b1bsmxi91zci6g8714rcljl620y7f-bash-5.2-p15/bin/sh: line 1: google-chrome-dev: command not found
INFO:WDM:Get LATEST chromedriver version for google-chrome

And here is the piece of code itself:

    else:
         options = Options()
         options.add_argument("--headless")
         options.add_argument("--disable-gpu")
         options.add_argument("--window-size=1920,1200")

         driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)

         try:
             driver.get(url)
             WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.TAG_NAME, "body")))
             text = driver.find_element(By.TAG_NAME, "body").text
             cleaned_text = re.sub(r'\s+', ' ', text)
             return cleaned_text[:max_chars]

         except TimeoutException:
             return "Page load time exceeded."
         finally:
             driver.quit()

Who knows how to solve this error? After all, as I understand it, on Replit you cannot connect access to a laptop and have the Internet work, right? Thanks in advance for your answer.

Hello @dbagaychik2!
Please look at my other Selenium Error posts:

2 Likes

Thank you for your answer! :sunglasses:

If that solved your problem, please mark it as Solution.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.