AttributeError: module 'selenium.webdriver.common.service' has no attribute 'Service'

mac2025-04-20  3

python3+selenium+pycharome与浏览器驱动配置成功后,运行测试代码,系统报错

 

 

在网上找了N多资料也没有找到解决资料,最后试验很久,发现卸载selenium,再重新安装selenium得以解决

pip uninstall selenium

pip install selenium

猜测可能是因为从python2切换到python3,selenium没有切换到对应的版本,所以运行时候报错,卸载后,自动下载安装到了对应的版本,得以解决

最新回复(0)