0

我尝试在 python 中使用 chromeoptions 打开浏览器,但遇到了一些问题,我已经给出了可执行路径,但它也是这样说的。使用 Selenium 的 Python 新手。需要帮助!!

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

我的代码:

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()
4

0 回答 0