0

i Tried using chromeoptions in python to open the browser, but am facing some issues ,i have given the executable path but also it is telling like that. New To Python With Selenium. Help Needed!!

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

My code :

from selenium import webdriver
import  unittest
from selenium.webdriver.chrome.options import Options


class Amazon(unittest.TestCase):

    def setUp(self):
        chrome_options = webdriver.ChromeOptions()
        chrome_options.add_argument("--disable-extensions")
        self.driver = webdriver.Chrome(chrome_options=chrome_options,executable_path="‪F:\\chromedriver.exe")


    def test_open_chrome(self):
        self.driver.get("https://www.amazon.in/")

    def tearDown(self):
        self.driver.quit()

if __name__ == '__main__':
    unittest.main()
koushick
  • 497
  • 2
  • 8
  • 30
  • 1
    Just add the folder where chromedriver.exe is located to the path. https://docs.alfresco.com/4.2/tasks/fot-addpath.html also make sure you've the latest driver https://sites.google.com/a/chromium.org/chromedriver/downloads – Pedro Lobito Dec 15 '18 at 19:47
  • Thanks@PedroLobito Worked out! Like you said i have added a folder where chromedriver is located. it is working fine but while running in console am getting this "DeprecationWarning: use options instead of chrome_options" that is i need to change it as Options right? – koushick Dec 15 '18 at 20:00
  • Yes, you can change to `options`. GL – Pedro Lobito Dec 15 '18 at 20:01

0 Answers0