【问题标题】:"Warning: Potential Security Risk Ahead" Error in Rselenium and Geckodriver-firefoxRselenium 和 Geckodriver-firefox 中的“警告:潜在的安全风险”错误
【发布时间】:2019-11-06 21:42:26
【问题描述】:

我正在尝试使用 RSelenium 访问页面。我在 R 中编写了我的代码,它在 Chrome 和 IE 中运行良好。但是当我使用 geckodriver 时,firefox 会显示以下消息,并且我在 R 控制台中收到错误消息:

Selenium message:
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info:os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_40'
Driver info: driver.version: unknown

Error:   Summary: UnknownError
     Detail: An unknown server-side error occurred while processing the command.
     class: org.openqa.selenium.WebDriverException
     Further Details: run errorDetails method

我发现我应该更改 firefox 配置文件,但它是 python 代码,我需要 R:

FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);

在R里应该是这样的

fprof <- makeFirefoxProfile(list(browser.download.dir = "D:/temp"))
remDr <- remoteDriver(extraCapabilities = fprof)

但我不知道具体应该写什么。

请你帮帮我。 或者,如果您知道我可以如何停用此警告!

【问题讨论】:

  • 我使用 Selenium C# 并通过以下代码解决了这个问题: if (driverName == "firefox") { // 初始化 Firefox 驱动程序 FirefoxOptions options = new FirefoxOptions(); options.AddAdditionalCapability("acceptInsecureCerts", true, true); options.AddAdditionalCapability("acceptUntrustedCerts", true, true); //options.Profile.AcceptUntrustedCertificates = true;

标签: r security firefox geckodriver rselenium


【解决方案1】:

Selenium 要求您将 both acceptInsecureCerts acceptUntrustedCerts 设置为 TRUE。此外,remoteDriver 已被弃用,因此您现在必须使用rsDriver,如下所示:

remDr=rsDriver(browser=browserName,extraCapabilities=list(acceptInsecureCerts=TRUE,acceptUntrustedCerts=TRUE))

【讨论】:

    猜你喜欢
    • 2022-11-25
    • 1970-01-01
    • 1970-01-01
    • 2020-04-03
    • 2019-09-20
    • 1970-01-01
    • 1970-01-01
    • 2013-07-07
    • 1970-01-01
    相关资源
    最近更新 更多