2017-05-07 136 views
0

我试图在其他线程上寻找答案,但并不觉得这些答案与我的情况有关(如果情况并非如此,我很抱歉)。这就是说,我想在IRBRUBY -Mechanize :: ResponseCodeError:503 => Net :: HTTPServiceUnavailable

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

基本上我试图webscrape亚马逊运行一个简单的Ruby脚本,出于某种原因,我遇到了这个错误:

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

有没有人遇到过这个?我觉得解决方案很简单,但我无法围绕它解决问题。

感谢您的时间,

-javi

+0

他们可能会抛出该错误,因为他们不喜欢你的user_agent字符串。 – pguardiario

+0

我宣布机械化的一个新实例? – javiwins

回答

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.

以上就是503手段。并且您的输出明确指出Net::HTTPServiceUnavailable

错误不是从您的结尾。如果我是你,我确实会确认目标服务器,看看它是否已经启动。

相关问题