# Mechanize 'stop button'

**URL:** <https://www.ruby-forum.com/t/mechanize-stop-button/152932>\
**Category:** Ruby\
**Created:** [November 10, 2008, 3:28am UTC](https://www.ruby-forum.com/t/mechanize-stop-button/152932 "2008-11-10T03:28:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fozbaca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f0a364/32.png) [@fozbaca](https://www.ruby-forum.com/u/fozbaca)\
**Post date:** [November 10, 2008, 3:28am UTC](https://www.ruby-forum.com/t/mechanize-stop-button/152932/1 "2008-11-10T03:28:44Z")

</div>

Hello, I’ve run into a bit of a situation with mechanize:

def get\_page  
agent = WWW::Mechanize.new  
agent.read\_timeout = 150  
page\_one = agent.get([www.foo.com](http://www.foo.com))  
page\_two = agent.submit(form) # will timeout  
rescue Timeout::Error  
page\_two.body # returns nil  
end

When the page eventually times out, i’d still like to parse what it  
gathered, but i can’t grab what it read. The functionality i really  
want is to ‘hit the stop button’ and grab what’s there.

Any ideas?
