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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:05:00+00:00 2026-06-07T04:05:00+00:00

I had my mechanize script running for roughly 3 hours before I got the

  • 0

I had my mechanize script running for roughly 3 hours before I got the following error:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/net-http-persistent- 
2.7/lib/net/http/persistent/ssl_reuse.rb:29:in `initialize': 
A connection attempt failed because the connected party did not properly 
respond after a period of time, or established connection failed because
connected host has failed to respond. - connect(2) (Errno::ETIMEDOUT)

I’m assuming it’s due to the fact that it’s been running for 2-3 hours but was wondering if anyone had any special insight about the error

Here is my script

require 'rubygems'
require 'mechanize'

def next_button(web_page)
  web_page.page.search('.next a').each do |next_button|
    web_page.click(next_button)
    web_page.page.search('.listing_content').each |info|
      get_info(info)
    end
  next_button(web_page)
  end
end

def get_info(info)
  infos = info.at_css('.url').text.strip
  address = info.css('.street-address').text.strip
  city = info.css('.locality').text.strip
  state = info.css('.region').text.strip 
  zip = info.css('.postal-code').text.strip
end

web_page = Mechanize.new                     
web_page.user_agent_alias = "Linux Firefox"
web_page.get(HOME_URL)

web_page.page.search('.page-navigation a').each do |pagination_link|
 web_page.page.search('.categories-list a').each do |link|  

    web_page.click(link)
    web_page.page.search('.listing_content').each do |info|  

      get_info(info)
    end
    next_button(web_page, worksheet)
  end

  web_page.click(pagination_link)
end    

Thanks for any help in advance.

  • 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-07T04:05:01+00:00Added an answer on June 7, 2026 at 4:05 am

    In my opinion persistent connections are more trouble than they’re worth. When this happens to me I check to make sure I have the latest version of mechanize, and if it still happens, I fall back to mechanize 1.0.0 which doesn’t use persistent connections.

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

Sidebar

Related Questions

Had this working; at one stage. The problem is the following text is now
I had a brainbench exam recently, got high mark, but there were a couple
I'm trying to install WWW::Mechanize; but of course, something had to go wrong. I
Before asking, I had refer to this older question . But I have still
Edit: Originally I had a simple form Ajax script that wasn't working, turns out
Had to download Command Line Tools from Apple to get make to work, but
Had a good read through similar topics but I can't quite a) find one
Had received a module from CCAVENUE and it was working fine with Magento 1.6.2...
Had a page that was working fine. Only change I made was to add
Had a good search here but can't see anything that gets my mind in

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.