From: Rochit Sen Date: 2013-05-07T03:17:24+09:00 Subject: Downloading a CSV using URI - mechanize Hi All, Got an issue. I am downloading a csv in a script written in Mechanize. I am setting some parameters on the webpage and then submit my form. This directs me to another page where i have the following href link (got it through firebug): --- CSV --- In my script to simulate click on this CSV href link, i take out the URI and download the file. The code for this is below: --- #Submitting the page with button Chnange Columns page=pageAgent.submit(checkboxForm,checkboxForm.buttons.first) #Retrieving the csv link href csv_href=pageAgent.page.link_with(:text => 'CSV').uri pageAgent.download("#{csv_href}",'c:/magma/1.csv')} --- Issue: The downloaded CSV file is missing some data which should be there. When i download the file directly from webpage i get correct results in csv file. So i was wondering, could it be an issue that i download the file using URI? As i noticed that the URI is lot bigger as compared to the href link generated on the page after the search parameters are set. Also if someone can tell me how can i download a file using the href itself using mechanize. Help much appreciated. I have also attached a txt file that has the URI and the href both for reference. Didnt wanted this post to be long to read unnecessarily. :) Attachments: http://www.ruby-forum.com/attachment/8397/URI_Href.txt -- Posted via http://www.ruby-forum.com/.