From: Rochit Sen Date: 2013-05-07T17:40:40+09:00 Subject: Re: Downloading a CSV using URI - mechanize Joel Pearson wrote in post #1108049: > Obviously I can't test your code under the same conditions, but from the > look of it you should get the same file if you do this manually. > > The main thing which looks like it could go wrong is the checkbox > section. > > allChkBoxes = checkboxForm.checkboxes > chkNames = [] # <= This is overwritten as a String each time > allChkBoxes.each do |chkBx| > chkNames = chkBx.name # Why not just do "chkBx.check" ? > checkboxForm.checkbox_with(:name => "#{chkNames}").check > end > > I think you're doing something differently with the options when running > this manually. Unless there's more than one link called CSV on the page? Hi Joel, i am setting all the checkboxes to true, so when the csv is downloaded i get all the columns. Setting the checkbox as true adds that specific column in the csv. It should not affect the csv output. What do you think? is my approach correct where i am getting the URI of the href 'csv' and dowloading the file. Also i think there is just one csv hyperlink on the page, though i will double check again. thanks. -- Posted via http://www.ruby-forum.com/.