小编she*_*ida的帖子

如何在 google colab 中为 geckodriver 插入路径(环境变量)?

我想通过 Gecko 驱动程序在 Google Colab 中运行 selenium,但它告诉我:可执行文件需要在 PATH 中

我在 Google Colab 中上传了 firefox 和 gecko 驱动程序并复制了 gecko 驱动程序的路径。该代码在我的 PC 上运行良好。

google clob 中的 firefox 和 gecko 驱动程序,但发生错误。

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait as wait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
import time
from selenium.webdriver.support import ui
from selenium.webdriver.common.by import By
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

from selenium.common.exceptions import TimeoutException


driver =  webdriver.Firefox(executable_path=r'content/geckodriver.exe')

WebDriverException: Message: 'content/geckodriver.exe' executable needs to be …
Run Code Online (Sandbox Code Playgroud)

firefox selenium path geckodriver google-colaboratory

5
推荐指数
1
解决办法
5050
查看次数