Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Using hpricot to get tables
lrlebron@gmail.com
7/1/2008 6:06:00 PM
I am working with the following script to parse a page
require 'hpricot'
require 'open-uri'
strLink ="
http://www.sportsline.com/mlb/gamecenter...
MLB_20080331_ARI@CIN"
strPath ="div[@class=SLTables1]/div"
@doc = Hpricot(open(strLink))
@doc.search(strPath) do |div|
puts div.inner_html
# puts div.css_path
# puts div.xpath
# puts
puts
end
This prints 4 tables to the screen
<table> blah, blah, blah </table>
<table> blah, blah, blah </table>
<table> blah, blah, blah </table>
<table> blah, blah, blah </table>
I would like to access each table individually. How can I do that?
Thanks,
Luis
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Using hpricot to get tables
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password