【发布时间】: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