rselenium

Short xPath in R for use with RSelenium

戏子无情 提交于 2019-12-11 10:18:57
问题 I have a problem when using findElement() from RSelenium with xPath on this page where the xPath expression for an element is very long, i.e. the element is nested deeply (I use firefox for the remote driver). findElement() works fine on the page if I use a short xPath expression that I get from inspecting the element e.g. in Google Chrome. However, in R (as far as I know) I can only retrieve the long xPath expression using for example xml_path() from package xml2 . Is there a way to get a

click href that contain javascript using Rselenium

懵懂的女人 提交于 2019-12-11 08:39:37
问题 I am using R, version 3.3.2. I am trying to scrap some data from this website: http://www.dziv.hr/en/e-services/on-line-database-search/patents/ I am using Rselenium and my code looks like this: webElem <- remDr$findElements("css", "iframe") remDr$switchToFrame(webElem[[1]]) webel <- remDr$findElement(using = "xpath", "//input[@id = 'TB1']")$sendKeysToElement(list(as.character("*"), key = "enter")) Sys.sleep(2) windows_handles <- remDr$getWindowHandles() Sys.sleep(1) remDr$switchToWindow

how to find <a href> element in a webpage using Rselenium?

空扰寡人 提交于 2019-12-11 04:36:14
问题 I have the following tag in a webpage: <a target="PARENT" href="/bin-din/WebOb/mom.ko/6/wo/asaksdaksjd /5.1.5.5.33.23.23">View Data Set</a> How can I lookup this element in Rselenium? For example if my current session is saved in remDr, what should I search for: webElem <- remDr$findElement(??) I need to search the element using it's display link (View Data Set) since the href link changes over time. Thanks much for your help 回答1: Try library(XML) fileUrl <- ("http:\\wherever you got your

rselenium | get youtube page source

独自空忆成欢 提交于 2019-12-11 04:26:50
问题 Why is the page source of youtube.com not scrapeable? I tried the following (using phantomjs as well as chrome with a selenium server) library(RSelenium) pJS <- phantom(pjs_cmd = ...) Sys.sleep(5) # give the binary a moment remDr <- remoteDriver(browserName = 'phantomjs') remDr$open() remDr$navigate("https://www.youtube.com/") remDr$getTitle()[[1]] # [1] "YouTube" remDr$getPageSource() Returns: Error in fromJSON(content, handler, default.size, depth, allowComments, : invalid JSON input 回答1:

Rselenium not working

限于喜欢 提交于 2019-12-11 00:17:18
问题 I'm trying to install Rselenium and I get this Connecting to remote server" Error: Summary: UnknownError Detail: An unknown server-side error occurred while processing the command. class: java.net.ConnectException" Code which I have tried is install.packages("RSelenium") library(RSelenium) startServer() checkForServer() mybrowser <- remoteDriver(browserName = "chrome") mybrowser$open() mybrowser$navigate("http://www.weather.gov") 回答1: Sometime I face a connection problem. Here what I make:

Specify download folder in RSelenium does not work

試著忘記壹切 提交于 2019-12-10 20:06:06
问题 Because my previous question remained unsolved, I tried to specify the download directory using firefox instead of chrome. So I specified the download directory: fprof <- makeFirefoxProfile(list(browser.download.manager.showWhenStarting=FALSE, browser.download.dir = "~/", browser.helperApps.neverAsk.saveToDisk="text/csv", browser.download.folderList = 2L)) remDr <- remoteDriver(extraCapabilities=fprof) as exactly is done here. However, the files still get downloaded in my default download

R: Rvest - got hidden text i don't want

孤人 提交于 2019-12-10 19:19:04
问题 I'm doing webscraping to this web: http://www.falabella.com.pe/falabella-pe/category/cat40536/Climatizacion?navAction=push I just need the information from the products: "brand", "name of product", "price". I can get that, but also i get the information from a banner with similar products by other users. I don't need it. But when i go to the source code of the page, i can't see those products. I think it's been pulled through javascript or something: QUESTION 1: How to block this information

RSelenium Select Dropdown/ComboBox Value from Javascript List

ⅰ亾dé卋堺 提交于 2019-12-10 00:22:08
问题 I am trying to download a csv file from a website using RSelenium. I get to the page, which is a Crystal Report Viewer, and select the element of the export button and click that button. Then an export window appears with a file format selection. I am able to find the element of the dropdown list but I am having issues with the values of the list. The values appear to be coming from a very long javascript script like the following: <script type="text/javascript" language="JavaScript"> `{"args

Is there an R package to access the google places API? [closed]

风流意气都作罢 提交于 2019-12-08 13:15:15
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I'm currently using Rselenium to input doctors' names into Google Maps, and then collect the addresses associated with those names. For example, if I input "Susan Marra" my current program would return "11782 Sand Point Way NE, Seattle, WA 98125", the address of her practice. This worked fine originally, but the

Web scraping password protected website using R

孤街醉人 提交于 2019-12-08 11:31:42
问题 i would like to web scrap yammer data using R,but in order to do so first il have to login to this page,(which is authentication for an app that i created). https://www.yammer.com/dialog/authenticate?client_id=iVGCK1tOhbZGS7zC8dPjg I am able to get the yammer data once i login to this page but all this is in browser by standard yammer urls (https://www.yammer.com/api/v1/messages/received.json) I have read through similar questions and tried the suggestions but still cant get through this