【问题标题】:Can Selenium be used on Google App Engine now?Selenium 现在可以在 Google App Engine 上使用吗?
【发布时间】:2019-07-22 08:49:00
【问题描述】:

我正在尝试在 Google App Engine 上运行 Selenium。几年前我看到很多cmets说你不能。我发现这个link 说无头Chrome 现在可以在GAE 上使用。这篇文章是在其他 cmets 说你不能在 GAE 上使用 selenium 之后写的,所以我试了一下。

from selenium import webdriver


browser = webdriver.Chrome()

将代码部署到 gae 后出现此错误:

ages/selenium/webdriver/common/service.py", line 76, in start      stdin=PIPE)    File "/opt/python3.7/lib/
python3.7/subprocess.py", line 775, in __init__      restore_signals, start_new_session)    File "/opt/pyth
on3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child      raise child_exception_type(errno_num,
 err_msg, err_filename)  FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver': 'chromedriver'

是我做错了什么还是我误解了链接的帖子?

【问题讨论】:

    标签: google-app-engine selenium-chromedriver python-3.7


    【解决方案1】:

    您提供的链接适用于 Node.js 运行时。它可能还没有在 python 中可用。

    通过执行以下操作,我能够使其在 App Engine Flex 上的 python 中运行

    Python Headless Browser for GAE

    对于您的具体错误,我不得不编辑 docker 文件以下载网络驱动程序

    【讨论】:

      猜你喜欢
      • 2012-10-25
      • 1970-01-01
      • 2015-02-15
      • 2012-03-25
      • 1970-01-01
      • 1970-01-01
      • 2020-05-27
      • 1970-01-01
      • 2011-02-12
      相关资源
      最近更新 更多