RSelenium with Tor with NEW RSelenium version on Windows

你说的曾经没有我的故事 提交于 2019-12-21 11:45:10

问题


I found this fantastic answer by @jdharrison on how to launch Tor using RSelenium on windows: https://stackoverflow.com/a/39048970/7837376

In the new version of RSelenium, however, startServer() is defunct and its replacement rsDriver() does not take a java argument as startServer() did before.

What is the way to launch Tor as above in firefox in the new RSelenium syntax? Thanks very much (in advance)!


回答1:


You can start the selenium server yourself instead of using rsDriver

browserP <- "C:/Users/john/Desktop/Tor Browser/Browser/firefox.exe"
jArg <- paste0("-Dwebdriver.firefox.bin=\"", browserP, "\"")
pLoc <- "C:/Users/john/Desktop/Tor Browser/Browser/TorBrowser/Data/Browser/profile.meek-http-helper/"
jArg <- c(jArg, paste0("-Dwebdriver.firefox.profile=\"", pLoc, "\""))

wdman::selenium(jvmargs=jArg, selargs='any selenium args')
remDr <- remoteDriver(browserName ="firefox", port=4567L)
driver <- remDr$open()


来源:https://stackoverflow.com/questions/50829457/rselenium-with-tor-with-new-rselenium-version-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!