r - Rselenium 和 Geckodriver-firefox 中的“警告:潜在的安全风险”错误
问题描述
我正在尝试使用 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 要求您将和都设置为。此外,已弃用,因此您现在必须使用,如下所示:acceptInsecureCerts
acceptUntrustedCerts
TRUE
remoteDriver
rsDriver
remDr=rsDriver(browser=browserName,extraCapabilities=list(acceptInsecureCerts=TRUE,acceptUntrustedCerts=TRUE))
推荐阅读
- c# - 使用 foreach 遍历枚举列表
- slack - 如何修复在 SLACK 中获取 users.profile.get 的错误
- python - Pandas OutOfBoundsDatetime 在清理 1677 之前日期的不同日期格式时
- java - 无法从下拉列表中单击/选择元素
- xml - WSO2 EI 分析
- javascript - 如何防止元素在jointjs中接触/碰撞?
- javascript - vuejs 在 Laravel 数组中形成计算
- reactjs - 如何在 react 项目中使用 npm link 在本地开发节点模块
- android - textView.setText(string) 和 textView.text = $string 有什么区别
- chocolatey - 依赖包的 Chocolatey 参数