调用时出错代码:
driver = webdriver.Chrome(resource_path("C:\\webdriver\\chromedriver.exe")) # to open the chromebrowser
driver.get("https://www.example.com")
解决方法
查找相关文档,将resource_path
替换成executable_path
即可解决,代码如下:
webdriver.Chrome(executable_path=r'C:\webdriver\chromedriver.exe') # to open the chromebrowser
driver.get("https://web.whatsapp.com")
相关文档: