0

I am using selenium in python collab. But I need to use the same code(I cannot download chromedriver) in my notebook. Here is the code:

!pip install webdriver-manager
!apt update
!apt install chromium-chromedriver
!pip install selenium
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
# open it, go to a website, and get results
driver = webdriver.Chrome(options=options)
driver.get("https:....")

I thought that this code may works in noteboot, but when I am running in notebook, this give me error

WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Is it possible to run this kind of code in notebook?

Sht
  • 179
  • 1
  • 1
  • 9
  • Yes. The error you see has nothing to do with jupyter - it just tells you that you have not configured the path to chromedriver. Please see: https://stackoverflow.com/questions/29858752/error-message-chromedriver-executable-needs-to-be-available-in-the-path – krassowski Apr 05 '21 at 17:05
  • I cannot download chromedriver, that why I need to something which works without download chromedriver like in colab – Sht Apr 05 '21 at 18:32
  • Why you cannot download chromedriver? Is there an error when you try to install it? – krassowski Apr 05 '21 at 18:34
  • In the computer, where I want to run the script, it is denied. – Sht Apr 06 '21 at 11:42

0 Answers0