from selenium import webdriver url="https://www.baidu.com" browser = webdriver.Edge(executable_path=r'C:\Program Files (x86)\Microsoft\Edge\Application\msedgedriver.exe') browser.get(url)
报错:
SessionNotCreatedException: session not created from tab crashed ? (Session info: MicrosoftEdge=94.0.992.50)
问题有四方面:
1、webdriver版本与浏览器对不上,Chrome经常会自动更新,换浏览器和驱动
2、编译器运行所需要的依赖包有问题,需要重新调,用pip安装selenium有时候不全面
3、换编译器PyCharm 目前亲测安装selenium包后运行ok,安装的时候看了一下附带好多个包
async-generator | 1.10 | | attrs | 21.2.0 | 21.2.0 | certifi | 2021.10.8 | 2021.10.8 | cffi | 1.15.0 | 1.15.0 | cryptography | 35.0.0 | 35.0.0 | h11 | 0.12.0 | 0.12.0 | idna | 3.3 | 3.3 | outcome | 1.1.0 | 1.1.0 | pip | 21.1.2 | 21.3 | pyOpenSSL | 21.0.0 | 21.0.0 | pycparser | 2.20 | 2.20 | selenium | 4.0.0 | 4.0.0 | setuptools | 57.0.0 | 58.2.0 | six | 1.16.0 | 1.16.0 | sniffio | 1.2.0 | 1.2.0 | sortedcontainers | 2.4.0 | 2.4.0 | tornado | 6.1 | 6.1 | trio | 0.19.0 | 0.19.0 | trio-websocket | 0.9.2 | 0.9.2 | urllib3 | 1.26.7 | 1.26.7 | wheel | 0.36.2 | 0.37.0 | wsproto | 1.0.0 | 1.0.0 |
4、更新了其中某一个包导致更新后的版本与旧版本兼容不上,这个是大大的坑
|