0

I'm trying to parse this HTML with R in order to extract some currency exchange rates. They are only visible after clicking on buttons in the center of the webpage (sorry, it's in Russian).

So far I've tried both Rselenium and rvest, but none of them allows me to get to this css: "tr:nth-child(2) td".

And if I try this:

library("RSelenium")
startServer()
mybrowser <- remoteDriver(browserName = "chrome")
mybrowser$open()
mybrowser$navigate("https://www.tinkoff.ru/about/documents/exchange/")
dol<-mybrowser$findElement(using = c('partial link text'), "USD")

it returns a "NoSuchElement" error.

I've highlighted the place in the html code where I need to get

1 Answers1

0

txt<- ".documents-exchange-vertical-list__menu:nth-child(2) .documents-exchange-vertical-list__item+ .documents-exchange-vertical-list__item .Currency-Rate-Trigger";

dol<-mybrowser$findElement(using = 'css selector', txt)clickElement()

#possibly this will work or may not dol<-mybrowser$findElement(using = 'css selector', "tr:nth-child(2) td:nth-child(1)")$getElementText()

Bharath
  • 1,600
  • 14
  • 25