From: James Britt Date: 2006-05-31T03:47:14+09:00 Subject: Re: Trying to download files using WWW::Mechanize Berger, Daniel wrote: > ... > With that, I can see the links to the .csv files, which look like this > on inspection: > > # ... , > @text="foo_May_29_..>", @href="foo_May_29_2006.csv"> > # ... , > @text="foo_May_30_..>", @href="foo_May_30_2006.csv"> > > How do I grab a particular file and load it into memory or onto the > local filesystem? I tried using the 'text' method (based on the > examples file) but that didn't seem to work for me. > I'm thinking you need to grab the href value, glom it onto the base URL, and use that with, say, open-uri, to fetch it. page.links.each{ |link| if link.href =~ /\.csv$/ full_url = url + link.href # Go read that URL ... end } -- James Britt "In Ruby, no one cares who your parents were, all they care about is if you know what you are talking about." - Logan Capaldo