Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read local HTML file into R

Tags:

html

r

I have a file on my desktop that's an HTML file. (In chrome, I right-clicked on the web page, chose "save-as" and then "Webpage, HTML"). How can I read this local file into R? Once in R I'm going to need to write some regular expressions to parse the strings and extract certain values.

like image 827
uspowpow Avatar asked Sep 29 '14 20:09

uspowpow


1 Answers

use readLines as follows

 rawHTML <- paste(readLines("path/to/file.html"), collapse="\n")
like image 105
Ricardo Saporta Avatar answered Sep 20 '22 20:09

Ricardo Saporta