webdata from R

#library(httr)

#install.packages("rvest")


install.packages("rvest")
library(rvest)
install.packages("RCurl")
library(RCurl)
install.packages("XML")
library(XML)
install.packages("plyr")
library(plyr)
install.packages("stringr")
library(stringr)

#http://www.omegahat.net
#http://www.omegahat.net/RSXML
#http://en.wikipedia.org/wiki/List_of_S%26P_500_companies
#http://en.wikipedia.org/wiki/Brazil_national_football_team

#Required packages :httr, rvest

temp <- getHTMLLinks("http://www.omegahat.net")
getHTMLLinks("http://www.omegahat.net/RSXML")


#http://en.wikipedia.org/wiki/List_of_S%26P_500_companies
tables <- GET("http://en.wikipedia.org/wiki/List_of_S%26P_500_companies")
tables <- readHTMLTable(rawToChar(tables$content))


theurl <- "http://en.wikipedia.org/wiki/Brazil_national_football_team"
file<-read_html(theurl)
tables<-html_nodes(file, "table")
table1 <- html_table(tables[4], fill = TRUE)

Post a Comment

Previous Post Next Post