【问题标题】:Selenium + C# + Chrome WebDriver: Violation of CSPSelenium + C# + Chrome WebDriver:违反 CSP
【发布时间】:2020-01-12 16:25:29
【问题描述】:

我正在使用基于 C# 和 Chrome webdriver 的 Selenium 运行控制台应用程序。

当我在没有无头选项的情况下运行它时,在控制台窗口中没有关于 CSP 的警告。

使用无头选项运行会导致:

Refused to connect to 'https://bla.bla/' because it violates the following Content Security Policy directive

每 1-2 秒收到一次这样的警告。

如何在这方面禁用 CSP,或过滤掉这些消息?

【问题讨论】:

    标签: c# selenium google-chrome webdriver


    【解决方案1】:

    解决了
    options.AddArgument("log-level=3");
    

    【讨论】:

      猜你喜欢
      • 2017-07-15
      • 2019-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多