使用Python Selenium 4.13仍提示"Chrome版本不支持"求助
解决Selenium 4.13自带Manager仍提示Chrome版本不兼容问题
先检查代码写法:别手动指定旧版chromedriver路径!如果之前写了
webdriver.Chrome(executable_path='xxx')这种代码,删掉executable_path参数,让Selenium Manager自动匹配驱动。正确代码示例:from selenium import webdriver driver = webdriver.Chrome()清理Selenium Manager缓存:缓存的旧驱动可能导致匹配失败,手动删除缓存目录后重启代码:
- Windows:删除
%USERPROFILE%\.cache\selenium下所有内容 - macOS/Linux:删除
~/.cache/selenium下所有内容
- Windows:删除
确保Chrome是最新版:打开Chrome→右上角三点→帮助→关于Google Chrome,完成更新后重启浏览器再运行代码。
验证Selenium版本:终端执行
pip show selenium确认版本是4.13.0,不是的话用pip install --upgrade selenium==4.13.0重新安装。
内容的提问来源于stack exchange,提问作者JimmyG
相关产品推荐
相关产品推荐

