Is there a way to get Mechanize to download a csv file, without loading
it all into memory first? As I understand even if I used a pluggable
parser, it will still download the whole file into memory before saving
it to a file?
Thanks!
···
--
Posted via http://www.ruby-forum.com/.
Is there a way to get Mechanize to download a csv file, without loading
it all into memory first? As I understand even if I used a pluggable
parser, it will still download the whole file into memory before saving
it to a file?
I don't actually know if this will solve your problem as I've not used it, but this looks like it is on the right track:
require 'rubygems'
require 'mechanize'
agent = WWW::Mechanize.new
agent.pluggable_parser.pdf = WWW::Mechanize::FileSaver
agent.get('http://example.com/foo.pdf'\)
then again, it might not. mechanize doesn't sound like a very good tool to be using for csv's in the first place as it can't actually DO much with them. Why not use a more straightforward tool like curl?
···
On Aug 27, 2009, at 20:07 , Raymond O'Connor wrote: