rselenium

Log In To Website Using RSelenium & phantomjs in R, Multiple Instances Of Class exist

巧了我就是萌 提交于 2019-12-01 21:36:09
I am trying to log in to this page: https://www.optionslam.com/accounts/login/ using the code on this post as a starting point, Scrape password-protected website in R I have been able to populate the login fields, but cannot click on the log in button. If you look at the source of the page, the class of login is "red-button" <input type="submit" value="Log in" class="red-button"/> However, there is another form at the top of the page that also uses the same class, and the clickElement() command is clicking on it. Reading the RSelenium documentation, I can't find a way to either search for the

Enable Adblocker Extension In Chrome Using RSelenium

天涯浪子 提交于 2019-12-01 19:44:41
I am scraping data in R from this page, http://finviz.com/screener.ashx?v=111&f=earningsdate_nextdays5 which displays popup ads. Those ads interfere with script so I'd like to enable the adblocker extension: https://chrome.google.com/webstore/detail/adblock/gighmmpiobklfepjocnamgkkbiglidom I'm working with code in the RSelenium package documentation here, https://cran.r-project.org/web/packages/RSelenium/RSelenium.pdf I found the profile directory by opening a chrome browser and navigating to: chrome://version/. This is my usual profile which has the adblocker extension enabled. However, when

R How to make a for loop without knowing the length?

谁说我不能喝 提交于 2019-12-01 11:08:59
Currently on this site I am scraping in the shot chart information. To scrape in the info I need to make a for loop for however many shots there are. I find the number of shots by clicking "Team Stats" and finding the number of field goal attempts. I would like to make the proper for loop without having to find out the number of shots. What I am currently doing: shotchart <- data.frame(shot=as.vector(0), class=as.vector(0), data_homeaway=as.vector(0), data_period=as.vector(0), player_id=as.vector(0), data_text=as.vector(0), location=as.vector(0), gamenumber= as.vector(0)) for (i in 1:54) {

Error while installing RSelenium in R

╄→尐↘猪︶ㄣ 提交于 2019-12-01 09:14:53
I am getting following error when I try to install the RSelenium package. install.packages("RSelenium") Installing package into ‘C:/Users/nshukla/Documents/R/win-library/3.2’ (as ‘lib’ is unspecified) Warning in install.packages : dependency ‘binman’ is not available also installing the dependencies ‘subprocess’, ‘semver’, ‘wdman’ There is a binary version available but the source version is later: binary source needs_compilation RSelenium 1.6.2 1.7.1 FALSE Packages which are only available in source form, and may need compilation of C/C++/Fortran: ‘subprocess’ ‘semver’ These will not be

Tor Browser with RSelenium in Linux/Windows

ⅰ亾dé卋堺 提交于 2019-12-01 08:26:19
Looking to use RSelenium and Tor using my Linux machine to return the Tor IP (w/Firefox as Tor Browser). This is doable with Python, but having trouble with it in R. Can anybody get this to work? Perhaps you can share your solution in either Windows / Linux. # library(devtools) # devtools::install_github("ropensci/RSelenium") library(RSelenium) RSelenium::checkForServer() RSelenium::startServer() binaryExtension <- paste0(Sys.getenv('HOME'),"/Desktop/tor-browser_en-US/Browser/firefox") remDr <- remoteDriver(dir = binaryExtention) remDr$open() remDr$navigate("http://myexternalip.com/raw") remDr

Tor Browser with RSelenium in Linux/Windows

青春壹個敷衍的年華 提交于 2019-12-01 07:17:13
问题 Looking to use RSelenium and Tor using my Linux machine to return the Tor IP (w/Firefox as Tor Browser). This is doable with Python, but having trouble with it in R. Can anybody get this to work? Perhaps you can share your solution in either Windows / Linux. # library(devtools) # devtools::install_github("ropensci/RSelenium") library(RSelenium) RSelenium::checkForServer() RSelenium::startServer() binaryExtension <- paste0(Sys.getenv('HOME'),"/Desktop/tor-browser_en-US/Browser/firefox") remDr

Error while installing RSelenium in R

…衆ロ難τιáo~ 提交于 2019-12-01 06:29:27
问题 I am getting following error when I try to install the RSelenium package. install.packages("RSelenium") Installing package into ‘C:/Users/nshukla/Documents/R/win-library/3.2’ (as ‘lib’ is unspecified) Warning in install.packages : dependency ‘binman’ is not available also installing the dependencies ‘subprocess’, ‘semver’, ‘wdman’ There is a binary version available but the source version is later: binary source needs_compilation RSelenium 1.6.2 1.7.1 FALSE Packages which are only available

Scraping webpage with react JS in R

混江龙づ霸主 提交于 2019-12-01 00:08:53
I'm trying to scrape page below : https://metro.zakaz.ua/uk/?promotion=1 This page with react content. I can scrape first page with code: url="https://metro.zakaz.ua/uk/?promotion=1" read_html(url)%>% html_nodes("script")%>% .[[8]] %>% html_text()%>% fromJSON()%>% .$catalog%>%.$items%>% data.frame In result I have all items from first page, but I don't know how to scrape others pages. This js code move to other page if that can help: document.querySelectorAll('.catalog-pagination')[0].children[1].children[0].click() Thanks for any help! You will need 'RSelenum' to perform headless navigation.

Scraping webpage with react JS in R

别来无恙 提交于 2019-11-30 18:34:04
问题 I'm trying to scrape page below : https://metro.zakaz.ua/uk/?promotion=1 This page with react content. I can scrape first page with code: url="https://metro.zakaz.ua/uk/?promotion=1" read_html(url)%>% html_nodes("script")%>% .[[8]] %>% html_text()%>% fromJSON()%>% .$catalog%>%.$items%>% data.frame In result I have all items from first page, but I don't know how to scrape others pages. This js code move to other page if that can help: document.querySelectorAll('.catalog-pagination')[0]

RSelenium: server signals port is already in use

假装没事ソ 提交于 2019-11-30 18:12:27
I'm using the following code in RSelenium to open a browser. After I close the browser, or even close the handler by running remDr$close(), the port is still in use. I have to go to the terminal and manually kill the process so that the same port becomes available. Is there any automated way such that RSelenium makes the port free after it finishes scraping? So here is my code: library(RSelenium) rD <- rsDriver(verbose = FALSE,port=4444L) remDr <- rD$client remDr$close() Thanks The process is composed of two parts a server (the Selenium Server) and a client (the browser you initiate). The