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 6754551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:17:39+00:00 2026-05-26T13:17:39+00:00

I am trying to a save a website to an HTML file using Ruby.

  • 0

I am trying to a save a website to an HTML file using Ruby.
When I open the file, the website is empty.

Currently trying:

doc = system("wget -r -l 1 http://google.com")
my_file = 'google.html'  
f = File.open(my_file, 'w')  
f.write(doc)  
f.close  

I can get it working using Nokogiri, but I’m trying to keep it as simplistic as possible.

  • 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-05-26T13:17:39+00:00Added an answer on May 26, 2026 at 1:17 pm

    I advise you to use Net::HTTP instead of any external utility to download pages in Ruby.

    But if you must, read this article on calling programs from Ruby.

    Basically you must call (backtick)wget ...(backtick) (sorry about the parser) or %x[wget ...] instead of system if you’re interested in the program’s output.

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

Sidebar

Related Questions

I'm trying to log in to a website and save an HTML page automatically
I'm trying to create a DLL using a Dataset.XSD file to access my website's
I'm trying to save a PDF file to SQL Server and I already have
I am trying to save images using the following code: - (void)writeData{ if(cacheFileName==nil) return;
I'm using httpclient to download images from a webpage and I'm trying to save
I am trying to upload a file via a form and then save in
I am trying to scrape an html table and save its data in a
I'm trying to add a file upload script in php to a website I'm
I'm trying a simple app to read in the HTML of a website, and
I am trying to make a website with a video background using HTML5's video

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.