Read local HTML file in R

I have a file on my desktop that contains an HTML file. (In chrome, I right-clicked on the webpage, selected "save-as" and then "Webpage, HTML"). How can I read this local file in R? Once in R, I will need to write some regular expressions to parse strings and extract specific values.

Thank you very much

+6
source share
1 answer

use readLines as follows

  rawHTML <- paste(readLines("path/to/file.html"), collapse="\n") 
+10
source

Source: https://habr.com/ru/post/976029/


All Articles