rselenium

how to remove a subset from a column within square brackets in r

家住魔仙堡 提交于 2019-12-13 18:21:05
问题 I've a column with has multiple strings in square brackets something like this [asdf] [ffgg][ asdf asdf asdf] sdfsgsfbsfg and I've to extract [asdf asdf asdf] it may have only one string like [asdf] or two. Please help 回答1: We can use str_extract library(stringr) str_extract(str1, "\\[(\\w+\\s+){2,}\\w+\\]") #[1] "[asdf asdf asdf]" Or may be str_extract(str1, "\\[(\\w+\\s+)\\1+[^]]+\\]") #[1] "[asdf asdf asdf]" data str1 <- "[asdf] [ffgg][asdf asdf asdf] sdfsgsfbsfg" 来源: https://stackoverflow

Web browser doesn't open in RSelenium

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 17:31:49
问题 I'm trying to move my first steps with RSelenium so after setting up server I launched remDr <- remoteDriver(remoteServerAddr = "192.168.99.100", port = 4445L, browserName = "firefox") remDr$open() Everything looks fine, I'me able to navigate and so on, unfortunately I can't see my session because browser doesn't open. How can I fix it? 来源: https://stackoverflow.com/questions/45457484/web-browser-doesnt-open-in-rselenium

RSelenium: Scraping links on page

一世执手 提交于 2019-12-13 07:39:14
问题 I'm relatively new to RSelenium. I have successfully managed to log into a site from where I need to pull all web links. That overview page looks like this: <a title="Search 'A2A'" href="/search?company=a2a&rf=13">A2A</a> <a title="Search 'ABB'" href="/search?company=abb&rf=13">ABB</a> <a title="Search 'Achmea'" href="/search?company=achmea&rf=13">Achmea</a> etc... this continues for another ~6000 links I have tried to use the following line to grab all the links, but this has not worked:

RSelenium in MAC

巧了我就是萌 提交于 2019-12-13 07:19:20
问题 I am using R R 3.1.1 on OS X Yosemite(10.10.4). I have recently installed RSelenium and I constantly receive an unknown error. The code that I use is as follow: require(RSelenium) checkForServer() startServer() Sys.sleep(5) remDr <- remoteDriver() remDr$open() The error is as follows: remDr$open() [1] "Connecting to remote server" Undefined error in RCurl call. Error in queryRD(paste0(serverURL, "/session"), "POST", qdata = toJSON(serverOpts)) : I tried downloading the selenium-java-2.41.0

RSelenium doesn't connect

半腔热情 提交于 2019-12-13 06:49:49
问题 I have a problem trying to connect with RSelenium package: > checkForServer() > startServer() $stop function () { tools::pskill(selPID) } <environment: 0x00000000039724d8> $getPID function () { return(selPID) } <environment: 0x00000000039724d8> > remDr <- remoteDriver() > remDr$open() [1] "Connecting to remote server" Error: Summary: UnknownError Detail: An unknown server-side error occurred while processing the command. class: org.openqa.selenium.WebDriverException I already configured Java

RSelenium: scraping a FULL expandable table

主宰稳场 提交于 2019-12-13 03:58:01
问题 Based off this question, the OP wants to scrape the table "All Holdings," from this page - scroll down to the yellow part. The table shows the first 10 rows, but can expand to quite a few more. Both of my rvest and RSelenium solutions only take the first 10 rows, when we want the entire table. My code: rvest code library(tidyverse) library(rvest) etf_url <- "http://innovatoretfs.com/etf/?ticker=ffty" etf_table <- etf_url %>% read_html %>% html_table(fill = T) %>% .[[5]] RSelenium code library

Docker: error during connect

安稳与你 提交于 2019-12-13 03:21:30
问题 I am getting the above error whenever i am trying to use RSelenium package shell('docker run -d -p 4445:4444 selenium/standalone-chrome') docker: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.30/containers/create: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running. See 'docker run --help

R Scrape a list of Google + urls using purrr package

淺唱寂寞╮ 提交于 2019-12-13 02:54:34
问题 I am working on a web scraping project, which aims to extract Google + reviews from a set of children's hospitals. My methodology is as follows: 1) Define a list of Google + urls to navigate to for review scraping. The urls are in a dataframe along with other variables defining the hospital. 2) Scrape reviews, number of stars, and post time for all reviews related to a given url. 3) Save these elements in a dataframe, and name the dataframe after another variable in the dataframe

Error in loadNamespace(name) : there is no package called ‘Rcompression’

烂漫一生 提交于 2019-12-13 01:24:24
问题 I am running a piece of code from RSelenium. I want to use my own Firefox browser profile to scrape websites. I am trying to run: fprof <- getFirefoxProfile("C:/Users/Administrator/AppData/Roaming/Mozilla/Firefox/Profiles/x51kgfa5.default") remDr <- remoteDriver(extraCapabilities = fprof) remDr$open() Unfortunately I am getting the Rcompression error. I have tried to locate an Rcompression package, but without any luck. Any thoughts on a possible solution would be greatly appreciated. 回答1:

Download Excel Files with RSelenium

亡梦爱人 提交于 2019-12-12 20:23:35
问题 I need to download an excel-file from a database (the reason that I cannot provide code). I'm able to click on the download icon using RSelenium . What happens next is that the usual dialogue-window opens asking me if I want to save the file or open it. How can I suppress this message and download the file into a folder? I have found a similar question regarding pdf here. The answer suggests it should be possible by specifying of the extraCapabilities : remDr <- remoteDriver(remoteServerAddr