1

i am trying to run the following code below on an AWS Juypter Notebook

import os  
from selenium import webdriver  
from selenium.webdriver.common.keys import Keys  
from selenium.webdriver.chrome.options import Options 

chrome_options = Options()  
chrome_options.add_argument("--headless")  

driver = webdriver.Chrome(chrome_options=chrome_options)  
driver.get("http://www.duo.com")  

the following error has occurred

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

I am trying to use the Selenuim package to connect to an online database while as trying to avoid setting up an EC2 Instance. if there is a work around regarding an EC2 instance I need help in finding that, however if an EC2 instance is needed then i must.

here is my path in which i am installed my chrome drivers

home/ec2-user/anaconda3/envs/
petezurich
  • 9,280
  • 9
  • 43
  • 57
James Scott
  • 181
  • 1
  • 13
  • Maybe you can look at this answer for reference https://stackoverflow.com/questions/29858752/error-message-chromedriver-executable-needs-to-be-available-in-the-path. Your 'PATH' environment variable is not having the location for chromedriver. – Rishabh Batra Feb 27 '20 at 17:34
  • @RishabhBatra i have looked into this, this seems to be using a local machine, however i am trying to do AWS – James Scott Feb 27 '20 at 18:27
  • You can also set environment variables using sys library of python. Here is the reference. https://stackoverflow.com/questions/37890898/how-to-set-env-variable-in-jupyter-notebook – Rishabh Batra Feb 28 '20 at 19:24

0 Answers0