【发布时间】:2020-02-17 16:38:02
【问题描述】:
我正在尝试在 Cloud Function 上使用 selenium webdriver chrome 运行一个简单的代码。我收到以下错误
消息:“chromedriver”可执行文件需要在 PATH 中。请看https://sites.google.com/a/chromium.org/chromedriver/home
如何在 Cloud Function 中指定 chromedriver 可执行文件?
下面是我的代码
from selenium import webdriver
import time
def test_webdriver(event=None, context=None):
driver = webdriver.Chrome()
driver.get('http://www.google.com/');
time.sleep(5)
search_box = driver.find_element_by_name('q')
【问题讨论】:
标签: python google-cloud-platform google-cloud-functions selenium-chromedriver