cmd窗口输入查找路径命令:where chromedriver
C:Program Files (x86)GoogleChromeApplicationchromedriver.exe
然后放入代码:
import unittest
import os
from selenium import webdriver
class CaseBase(unittest.TestCase):
@classmethod
def setUp(cls) -> None:
os.system("taskkill / im chromedriver.exe /f")
cls.driver = webdriver.Chrome(‘C:Program Files (x86)GoogleChromeApplicationchromedriver.exe’)