【问题标题】:Lighthouse Report via Python通过 Python 进行灯塔报告
【发布时间】:2021-11-09 09:34:37
【问题描述】:

我正在尝试使用 Lighthouse 打开默认网络浏览器 Chrome,而不是无头浏览器,因为我需要登录我的 Google 帐户。

--chrome-flags 传递给 Chrome 的自定义标志(空格分隔)。
检查下面的链接以了解 --chrome-flags。
https://github.com/GoogleChrome/lighthouse

    stream = os.popen('lighthouse --chrome-flags="--headless"--disable-storage-reset="true" --preset=' +
                      preset + ' --output=json --output-path='+relative_path + name+'_'+getdate+'.report.json ' + url)

如何更改“--chrome-flags”以打开我已安装的 Chrome 应用,而不是一个无头应用?

【问题讨论】:

    标签: python python-3.x google-chrome automation lighthouse


    【解决方案1】:

    尝试将--chrome-flags="--headless" 更改为--chrome-flags="--headed"

    【讨论】:

      猜你喜欢
      • 2021-10-16
      • 2019-12-05
      • 2014-07-02
      • 1970-01-01
      • 1970-01-01
      • 2018-08-27
      • 2021-08-16
      • 2017-03-08
      • 1970-01-01
      相关资源
      最近更新 更多