It isn't and I made a quick screenr to show you how.
So in summary:
install.packages('RSelenium')
library(RSelenium)
checkForServer()
startServer()
remDr <- remoteDriver()
remDr$open()
remDr$navigate("http://www.google.com/ncr")
remDr$findElement(using = "name", value = "q")
remDr$highlightElement()
webElem$sendKeysToElement(list("R Cran"))
webElem$clearElement()
webElem$sendKeysToElement(list("R Cran", key = "enter"))
remDr$close()
remDr$closeServer()
When I type startServer, it opens a java but it is empty.
ReplyDeleteWhat I have to do ?
Hi darannu. Yes the latest version of RSelenium writes the log to file in the /bin directory in the RSelenium package. https://github.com/johndharrison/RSelenium/blob/master/R/util.R#L61 so the java screen appears blank but is still working.
DeleteI can`t connect phantomjs to R.
DeleteI type:
remDr <- remoteDriver(browserName = "phantomjs")
remDr$open()
but it shows:
info: driver.version: unknown
I also type:
remDr <- remoteDriver(browserName = "C:/Users/annunzid/Desktop/phantomjs-1.9.7-windows/phantomjs.exe")
but whit the same result.
What I have to do ?
Hi darannu,
Deletephantomjs needs to be in your path. So you would add C:/Users/annunzid/Desktop/phantomjs-1.9.7-windows/ to your path. See the explanation http://stackoverflow.com/questions/9546324/adding-directory-to-path-environment-variable-in-windows.
Alternatively you can give the path to the phantomjs binary as an argument. In your case that would be:
remDr <- remoteDriver(browserName = "phantomjs", extraCapabilities = list(phantomjs.binary.path = "C:/Users/annunzid/Desktop/phantomjs-1.9.7-windows/phantomjs.exe"))
It`s ok. Thaksssss
DeleteJohn sorry but I have another question,
DeleteI`m trying to Scrape Flight Ticket Data Using R and Phantomjs, I have seen your code and it work for this webpage :
http://www.finn.no/reise/flybilletter/resultat?numberOfChildren=0&tripType=roundtrip&requestedDestination=PEK.AIRPORT&requestedReturnDate=15.09.2014&requestedOrigin=OSL.AIRPORT&requestedDepartureDate=01.09.2014&numberOfAdults=1
but why the same code doesn`t work for this one:
http://www.skyscanner.it/trasporti/voli/rome/it/voli-piu-economici-da-roma-per-italia.html?rtn=1&oym=1405&iym=1405
I`m not able to parse the html.
Thanks in advance
Hi Darannu,
DeleteThis site is checking for the user agent. You can call extra phantomjs settings using
phantomjs.page.settings.SETTING = VALUE where SETTING is taken from https://github.com/ariya/phantomjs/wiki/API-Reference-WebPage#webpage-settings. In this case we can set a user agent so the site see us as firefox 29:
appURL <- "http://www.skyscanner.it/trasporti/voli/rome/it/voli-piu-economici-da-roma-per-italia.html?rtn=1&oym=1405&iym=1405"
library(RSelenium)
addCap <- list(phantomjs.page.settings.userAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20120101 Firefox/29.0")
remDr <- remoteDriver(browserName = "phantomjs"
, extraCapabilities = addCap)
remDr$open()
remDr$navigate(appURL)
tableElem <- remDr$findElement("id", "browse-data-table")
xData <- tableElem$getElementAttribute("outerHTML")[[1]]
xData <- htmlParse(xData, encoding = "UTF-8")
readHTMLTable(xData)
This comment has been removed by the author.
DeleteThis comment has been removed by the author.
DeleteGood idea I have submitted the tutorial for DO to review as a community post... دانلود آهنگ جدید
DeleteThis comment has been removed by the author.
ReplyDeleteHi John,
ReplyDeleteI am having trouble connecting to PhantomJS using RSelenium on windows 7. Commands typed:
require(RSelenium)
RSelenium::startServer()
remDr <- remoteDriver(browserName = "phantomjs", extraCapabilities = list(phantomjs.binary.path = "C:/Users/home/Desktop/phantomjs-1.9.8-windows/phantomjs.exe"))
remDr$open()
$class
[1] "org.openqa.selenium.UnsupportedCommandException"
$additionalInformation
[1] "\nDriver info: driver.version: unknown"
Hi Alex,
DeleteCan you file an issue at https://github.com/ropensci/RSelenium and ill look into it.
Best Regards
John Harrison
There is a connection error.
ReplyDelete```{r}
#'devtools::install_github("ropensci/RSelenium")
#'system('cmd cd Documents')
#'system('cmd java -jar selenium-server-standalone-2.44.0.jar')
library(RSelenium)
library(rJava)
#'RSelenium::checkForServer(update=TRUE)
RSelenium::startServer()
Sys.sleep(5)
webDr <- remoteDriver(browserName='chrome')
#'webDr <- remoteDriver(browserName="chrome", extraCapabilities = list(chrome.binary.path = "C:/Users/Scibrokes Trading/Documents/chromedriver.exe"))
#'webDr <- remoteDriver(browserName='firefox')
webDr$open(silent=TRUE)
webDr$navigate('https://www.google.com/webhp')
```
Thanks in advance.
I get pleasure from on your great Work with a bit of time to share this Devops As a Service data within a uncomplicated in addition to step-by-step approach, making sure that readers in addition to followers can potentially Fully grasp the theory. When i Work have to get pleasure from people placing most of these with facts..
ReplyDeleteI have read your blog and I gathered some needful information from your blog. Keep update your blog. Awaiting for your next update. Thanks
ReplyDeleteDedicatedHosting4u.com
Nice article and great information thanks for sharing your thoughts.
ReplyDeleteThanks
Cpa offers
I really like your blog. You make it interesting to read and entertaining at the same time. I cant wait to read more from you...
ReplyDeleteInfromatica Online Training
It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
ReplyDeletehttp://chennaitraining.in/google-cloud-training-in-chennai/
http://chennaitraining.in/qtp-training-in-chennai/
http://chennaitraining.in/pega-training-in-chennai/
http://chennaitraining.in/tibco-amx-bpm-training-in-chennai/
http://chennaitraining.in/perl-training-in-chennai/
http://chennaitraining.in/unix-training-in-chennai/
Really great post admin thanks for sharing this.
ReplyDeleteJioTV live for PC
Vivavideo for PC Download
Cartoon HD for PC Apk
Jio Fiber Register
Snapseed for PC
Whatsapp for laptop
great tips for aws we at SynergisticIT offer the best aws bootcamp training in bay area
ReplyDeletevery nice blogs!!! i have to learning for lot of information for this sites...Sharing for wonderful information. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing
ReplyDeleteHorizontal Asymptote
utsa blackboard
Special Right Triangles
Perfect Square Trinomial Formula
anesthesia technician course syllabus
What are the Scientific Reasons for Choosing Printed Books
favourite fruit mango
bds full form
how to make your essay longer
VITA for PC
ReplyDeleteTextPlus for PC
Atlas for PC
Free Touch VPN for PC
Proxy Master VPN for PC
ReplyDeleteNetflix on PC
VPN 360 for PC
Hotstar for PC
Data Science online courses teach you the most effective way of learning and techniques for extracting actionable data. Now Inventateq offers data science online training so you can learn data science from your home. In terms of online learning, the Data Science course online provides you a better way of the online learning experience. Join the fastest-growing Data Science course online and gain certification with India's top-ranked faculty Inventateq Data science online course https://www.inventateq.com/online-data-science-training-courses.php
ReplyDeleteInventateq Data science courses in Bangalore
https://www.inventateq.com/data-science-training-courses-bangalore.php
I'm hoping you have some insight for me. I very sincerely appreciate your time. Perhaps this topic may be a good one to blog about. I imagine I'm not the only one trying to figure this out. Plus, with the fires in Northern California, seems like a lot of guys are getting back into construction after having let their licenses expire.
ReplyDeletethetechiefinds.com
thetechmagazines.com
thetechiefind.com
thetechtrending.com
ReplyDeleteGreat article. This blog is filled with unique and high-quality articles.
SHAREit for PC
VITA Video Editor for PC
PLAYit Video Player for PC
Helo app for PC
SHAREit for PC Windows
CandyLink for PC
PUBG for PC
I need to thank you for this very good read and i have bookmarked to check out new things from your post. Thank you very much for sharing such a useful article and will definitely save and revisit your site.
ReplyDeleteevs full form
raw agent full form
full form of tbh in instagram
dbs bank full form
https full form
tft full form
pco full form
kra full form in hr
tbh full form in instagram story
epc full form
A very nice blog! We have a professional developer team. Qdexi Technology provides an SEO content writing company.
ReplyDelete