
我使用的是 Windows 10。在 Google Colab 中,我执行了以下命令:
!pip install selenium
!apt-get update
!apt-get install -y chromium-browser
!apt install chromium-chromedriver
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
现在我需要执行:
driver=webdriver.Chrome(path)
您能告诉我如何在 Windows 上搜索安装驱动程序的“路径”吗?提前谢谢您。
答案1
默认安装位置是/usr/lib/chromium-browser/chromedriver
。
(但是我见过的所有关于在 Google Colab 中使用 WebDriver 的指南似乎都指示!cp /usr/lib/chromium-browser/chromedriver /usr/bin
在之后运行!apt install chromium-chromedriver
。)