Displaying 1 result from an estimated 1 matches for "grep1".
Did you mean:
grep
2008 Apr 12
1
Extracting a data.frame from HTML code
...I'm currently using readLines() to read in the HTML code and then grep() to
isolate the block of HTML code I want from each page, but this may not be
the best approach.
A short example:
x1 <- readLines("
http://www.nascar.com/races/cup/2007/1/data/standings_official.html",n=-1)
grep1 <- grep("<table",x1,value=FALSE)
grep2 <- grep("</table>",x1,value=FALSE)
block1 <- x1[grep1:grep2]
It seems like there should be a straightforward solution to extract a
data.frame from the HTML code (especially since the data is already
formatted as a table...