The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, and can follow links and submit forms. Form fields can be populated and submitted. Mechanize also keeps track of the sites that you have visited as a history.
Gemfile gem 'mechanize', '~> 2.2.1'
install gem install mechanize -v 2.2.1