【发布时间】:2020-02-01 15:27:12
【问题描述】:
我正在 GCP 上定义一个云函数,用于在 Python 中抓取网站。
我从定义一个简单地打开 webdriver 的函数开始:
from selenium import webdriver
def launch_search(request):
# Starting a webdriver
driver = webdriver.Chrome()
return 'Success'
这个功能不起作用(Error: could not handle the request 当我触发它时),可能是因为我的远程机器上没有安装 Chrome 驱动程序。因此:
- 如何安装?
- 或者我可以使用 Selenium 抓取网页,而无需使用网络驱动程序打开页面吗?
【问题讨论】:
标签: python selenium web-scraping google-cloud-platform automation