# Download button - how to get file with mechanize

**URL:** <https://www.ruby-forum.com/t/download-button-how-to-get-file-with-mechanize/192007>\
**Category:** Ruby\
**Created:** [July 22, 2010, 11:25am UTC](https://www.ruby-forum.com/t/download-button-how-to-get-file-with-mechanize/192007 "2010-07-22T11:25:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/8e7dd6/32.png) [@zak](https://www.ruby-forum.com/u/zak)\
**Post date:** [July 22, 2010, 11:25am UTC](https://www.ruby-forum.com/t/download-button-how-to-get-file-with-mechanize/192007/1 "2010-07-22T11:25:30Z")

</div>

hi,

i’m having problems to access the content of a (csv-)file behind a  
download-button inside a form:

... ...

any idea how to read or download the file?  
form.click\_button(form.button\_with(‘ctl00$cphContent  
$btnDownload’)).body  
apparently yields the first line of the file?!
