title: How to fix Selenium Error (Python) - Message: 'chromedriver.exe' executable needs to be in PATH
body: <blockquote>
  <p>from selenium import webdriver
  from selenium.webdriver.chrome.service import Service</p>
  </blockquote>
  <pre><code>class Pinterest:
     def __init__(self, email: str, password: str) -&gt; None:
      
      self.email = email  
      self.password = password 
      self.webdriver_path = os.path.abspath('assets/chromedriver.exe')
      self.driver = self.webdriver()  
      self.login_url = 'https://www.pinterest.com/login/'
      self.upload_url = 'https://www.pinterest.com/pin-builder/'
  
     def webdriver(self):
      
      options = webdriver.ChromeOptions()  
      options.add_argument('--lang=en')  
      options.add_argument('log-level=3')  
      options.add_argument('--mute-audio')  
      driver = webdriver.Chrome(service=Service(  
          self.webdriver_path), options=options) 
      driver.maximize_window()  
      return driver
  </code></pre>