[R] how to read a web page and extract an html table?

Detlef Steuer Detlef.Steuer at unibw-hamburg.de
Wed May 7 08:18:59 CEST 2003


Hi!

On 06-May-2003 Adi Humbert wrote:
> Hello all, 
> 
> I want to read a table from a given web page. 
> 
> If I do something like
>> str="http://www...."      # this is the web address
>> aux1 <- url(str,open="rt")# open connection 
>> aux2 <- readLines(aux1)   # read web page 
> aux2 contains the html file. 
> 
> I want to extract the table from the html file. 
> Is there a function html2R, the opposite of R2html? 
> How should I do this? 

I think the easiest way is using perl as preprocessor:
http://www.devshed.com/Server_Side/Perl/DataMining/page3.html


hope this helps,
dst

> 
> Thanks, 
> Adrian
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help

"There is no way to peace, peace is the way." -- Ghandi

Detlef Steuer --- http://fawn.unibw-hamburg.de/steuer.html
***** Encrypted mail preferred *****




More information about the R-help mailing list