2024-09-28 17:00:11 发布
网友
尽管我已经安装了Python,并且可以在命令提示符下确认它
VSCode还显示了安装的python
我也在同一个位置安装了pip
当我运行DoImport selenium时,仍然会出现此错误
不知道我错过了什么
For using selenium in chrome you have to download selenium chrome driver not selenium. So, download the selenium chrome driver from below link & Include path in code. Note that, You have latest version of chrome
[链接]https://chromedriver.chromium.org/downloads
下载后,在代码中包含如下路径
driver = webdriver.Chrome(executable_path="C:\\chromedriver.exe")
请参考以下内容检查模块“selenium”的安装情况:
请使用命令“pip version”检查模块安装工具“pip”的源代码是否与显示在VS代码左下角的python相同:(如果不同,请使用快捷键Ctrl+Shift+`打开新的VS代码终端,它将自动进入所选环境。)
pip version
在所选环境中完成安装后,我们可以使用“pip show selenium”检查其安装位置:..:\lib\site-packages
pip show selenium
..:\lib\site-packages
运行:
参考:Python environment in VS Code
[链接]https://chromedriver.chromium.org/downloads
下载后,在代码中包含如下路径
请参考以下内容检查模块“selenium”的安装情况:
请使用命令“
pip version
”检查模块安装工具“pip”的源代码是否与显示在VS代码左下角的python相同:(如果不同,请使用快捷键Ctrl+Shift+`打开新的VS代码终端,它将自动进入所选环境。)在所选环境中完成安装后,我们可以使用“
pip show selenium
”检查其安装位置:..:\lib\site-packages
运行:
参考:Python environment in VS Code
相关问题 更多 >
编程相关推荐