You can use htmlTreeParse and xpathApply from the XML library. something like:
xpathApply( htmlTreeParse("http://blabla", useInt=T), "//td", function(x) xmlValue(x)) should do it. Gamma wrote: > > anyone care to explain how to read a html table, it's streaming data > (updated every second) and i am looking for a suitable function. > > The imported html tables looks like this: > > [1] "<body><html><table>" > [2] "<tr><td>SEQUENCE</td> <td>EXCHANGE</td> <td>BOARD</td> <td>TIME</td> > <td>PAPER</td> <td>BID</td> <td>BID-DEPTH</td> <td>BID-DEPTH-TOTAL</td> > <td>BID-NUMBER</td> <td>OFFER</td> <td>OFFER-DEPTH</td> > <td>OFFER-DEPTH-TOTAL</td> <td>OFFER-NUMBER</td> <td>OPEN</td> > <td>HIGH</td> <td>LOW</td> <td>LAST</td> <td>CHANGE</td> > <td>CHANGE-PERCENT</td> <td>VOLUME</td> <td>VALUE</td> <td>TRADES</td> > <td>STATUS</td></tr>" > [3]"<tr><td>184311995</td><td>ST</td><td></td><td>174336</td><td>SX50PI</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>953.9600</td><td>937.9800</td><td>947.5900</td><td>2.6000</td><td>0.2751</td><td></td><td></td><td></td><td></td></tr>" > > and so on to the table closing brackets. > > [15] "</table></html></body>" > > > Tried a few commands but i only get html code back, like above: > readLines(url("")), socketConnection() and url() and nothing seemingly > useful comes up with apropos("html") either. > > > Regards > -- View this message in context: http://www.nabble.com/Read-HTML-table-tf4832010.html#a13825471 Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.