Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9164285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:38:44+00:00 2026-06-17T14:38:44+00:00

I browsed the documentation Mechanize . The below is for .pdf only. require ‘mechanize’

  • 0

I browsed the documentation Mechanize. The below is for .pdf only.

require 'mechanize'

agent = Mechanize.new
agent.pluggable_parser.pdf = Mechanize::FileSaver
agent.get 'http://example.com/foo.pdf'
  1. But can I also download .docx,.xlsx,.txt file also?
  2. when the file download will be done,what would be it’s default directory? Can we change the save file directory too?
  3. which browser would it select during downloading? Can we also change the browser control?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:38:46+00:00Added an answer on June 17, 2026 at 2:38 pm
    1. The type of file doesn’t matter; any file accessible over the net can be obtained via mechanize, which is a tool for automating interaction with Mechanize.

    2. The file will be stored in the directory where the program was run. Use Mechanize::Download instead of Mechanize::FileSaver to specify where the file should be downloaded to. Example code here: https://stackoverflow.com/a/9105153/429758 (Specify the full path in the filename)

    3. Mechanize doesn’t use a browser while downloading. For all intents and purposes, Mechanize acts like a web browser with no user interface via http://ruby.about.com/od/tasks/a/The-Mechanize-2-0-Handbook.htm

    Do checkout the EXAMPLES page on mechanize documentation for further examples about how to use mechanize.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've read the Django documentation here: http://docs.djangoproject.com/en/dev/ref/forms/validation/ I've also browsed a number of search
I browsed through the Windows Phone 7 documentation web site, and was unable to
The MSDN documentation on WebBrowser Customization explains how to prevent new windows from being
I've browsed the documentation on DotNetOpenAuth and cannot find a method to retrieve the
I've browsed the module development documentation but I can't find an API that would
Microsoft's Report Manager documentation here: http://msdn.microsoft.com/en-us/library/ms157147(v=sql.105).aspx states to start Report Manager: 2.In the address
I have browsed the documentation, but didn't find one. Any ideas?
I've browsed through the documentation but couldn't find anything mentioning this. I'm using Angular's
There is documentation for DWR exception handling for Client side: http://directwebremoting.org/dwr/documentation/browser/errors.html But I'm looking
Recently I browsed symfony2 api docs and here is what i've found in documentation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.