“警告:Rselenium和Geckodriver-firefox中的潜在安全隐患”错误

问题描述 投票:3回答:1

我正在尝试使用RSelenium访问页面。我用R语言编写了代码,并且在Chrome和IE中都可以正常工作。但是,当我使用geckodriver时,firefox显示以下消息,并且我在R控制台中看到一个错误:

enter image description here

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)

但是我不知道我应该写什么。

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

r security firefox geckodriver rselenium
1个回答
-2
投票

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

remDr=rsDriver(browser=browserName,extraCapabilities=list(acceptInsecureCerts=TRUE,acceptUntrustedCerts=TRUE))
© www.soinside.com 2019 - 2024. All rights reserved.