/mechanize_form_scraper_example

A Ruby Mechanize example to download files requiring forms, cookies, and or hidden token fields.

Primary LanguageRubyMIT LicenseMIT

Simple Mechanize Form Scraper

This code shows how to use mechanize to grab a list of links, visit each, and submit the download form on each visited page.

Installation

Install ruby or check if your system has ruby by typing ruby -v. Any recent version should do.

  • Run gem install bundler (this only needs to be done once ever on a ruby setup)
  • Run bundle install from the folder of this example
  • Run bundle exec simple_mechanize_scraper.rb to download the files!