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 Answer 1

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()

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.