I am trying to extract only the calendar with the most important events from the following page: https://www.investing.com/economic-calendar/. I have managed to select my time zone and tomorrow's calendat, but have difficulties selecting most important events.
This is what I have so far:
require(RSelenium)
remDr <- remoteDriver(port = 4445L)
remDr$open()
remDr$navigate("https://www.investing.com/economic-calendar/")
#Select the dropdown menu
option <- remDr$findElement("id", "timeZoneGmtOffsetFormatted")
option$clickElement()
remDr$executeScript("arguments[0].click();"
, list(remDr$findElement("id", "liTz57")))
#Select tomorrow
option <- remDr$findElement("id", "timeFrame_tomorrow")
option$clickElement()
As the javascript trick worked with the dropdown menu, I have tried the following to get the most important events:
option <- remDr$findElement("id", "filterStateAnchor")
option$clickElement()
remDr$executeScript("arguments[0].click();"
, list(remDr$findElement("id", "importance3")))
The checkbox is not visible when the filter button is clicked, yet the same thing was not a problem when selecting my time zone. How can I click the checkbox to select only the most important events?
Aucun commentaire:
Enregistrer un commentaire