【问题标题】:Installing Chrome with Playwright on Google Cloud Run for Python在适用于 Python 的 Google Cloud Run 上使用 Playwright 安装 Chrome
【发布时间】:2022-12-03 19:16:04
【问题描述】:

每当我尝试安装适用于 Python 的 Playwright 时,我都会在 Google Cloud Run 上收到 Executable doesn't exist at /root/.cache/ms-playwright/chromium-1019/chromium-1019/chrome-linux/chrome 错误,而且我找不到解决方法,我已经尝试下载并安装 Chrome 版本,但我不知道该找谁设置它的路径。

有没有人能够做到这一点?

【问题讨论】:

    标签: google-cloud-run playwright-python


    【解决方案1】:

    正如document 中提到的,可能会出现此错误,因为每个版本的 Playwright 都需要特定版本的浏览器二进制文件才能运行。默认情况下,Playwright 将 Chromium、WebKit 和 Firefox 浏览器下载到操作系统特定的缓存文件夹中。

    您可以按照 document 中建议的步骤克服此错误。

    1. 下载特定版本的 Playwright 浏览器
    2. 让 Playwright 从下载位置启动浏览
    3. (可选)要求编剧默认不下载浏览器,提高包安装速度

      你可以尝试使用executablePath to point to the installed version

      有关更多信息,您可以参考这些Link1Link2Link3可能对您有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-01-14
      • 2021-11-10
      • 1970-01-01
      • 2016-12-21
      • 1970-01-01
      • 2020-09-28
      • 2021-02-07
      • 2022-11-14
      相关资源
      最近更新 更多