ãããªæãã«æ¸ãã¦åããã¦ããã¨ããã§ãï¼ agent = WWW::Mechanize.new {|a| a.log=Logger.new(âaccess.logâ)} while # ã©ãã©ããã¼ã¿ãéããï¼ begin page = agent.get(url) rescue Timeout::Error puts â caught Timeout::Error !â retry # ã¿ã¤ã ã¢ã¦ããã¡ãã£ã¦ããããããªãï¼ rescue WWW::Mechanize::ResponseCodeError => e case e.response_code when â404â puts â caught Net::HTTPNotFound !â next # ãã¼ã¸ãè¦ä»ãããªãã¨ãã¯æ¬¡ã¸ when â502â puts â caught Net::HTTPBadGateway !â
{{#tags}}- {{label}}
{{/tags}}