R webscraping: interrogating for date and importance

Posted by adam.888 on Stack Overflow See other posts from Stack Overflow or by adam.888
Published on 2014-05-22T19:40:10Z Indexed on 2014/05/29 21:28 UTC
Read the original article Hit count: 200

Filed under:

I am able to webscrape a table from a webpage containing news

library(XML)
webpage  <- "http://www.tradingeconomics.com/calendar"
tables <- readHTMLTable(webpage )
n.rows <- unlist(lapply(tables, function(t) dim(t)[1]))

dfcal <- as.data.frame(tables$calendar)

However I do not know how to interrogate for date or for importance.

For example how could I webscrape news from Jan 2014? I am able to do this on the webpage by altering button settings, but how can I do it from within R?

I was also not able to collect the importance column data.

Also are there better ways for collecting economic news from within R? I have looked on http://www.rseek.org/ but could not find anything. Thank you for your help.

© Stack Overflow or respective owner

Related posts about r