0

I tried looking for answers on other threads but didn't feel like the responses were relevant to my situation (I apologize if that's not the case). That said, I am trying to run a simple ruby script in irb

>     require 'mechanize'
>     
>     agent = Mechanize.new
>     
>     page = agent.get('https://www.amazon.com/')

Essentially I am trying to webscrape Amazon, and for some reason I am running into this error:

> Mechanize::ResponseCodeError: 503 => Net::HTTPServiceUnavailable for
> https://www.amazon.com/ -- unhandled response

Has anyone ever encountered this before? I feel like the solution is simple, but I can't wrap my brain around it.

Thanks for your time,

-javi

1 Answers1

0

The Web server (running the Web site) is currently unable to handle the HTTP request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. Some servers in this state may also simply refuse the socket connection, in which case a different error may be generated because the socket creation timed out.

The above is what 503 means. And your output clearly states Net::HTTPServiceUnavailable

The error is not from your end. If I were you I'd actually confirming the destination server to see if it's up.

emi
  • 2,830
  • 5
  • 31
  • 53