0

Here is the web address which I want to parse it
http://e-service.cwb.gov.tw/HistoryDataQuery/MonthDataController.do?command=viewMain&station=467300&stname=%25E6%259D%25B1%25E5%2590%2589%25E5%25B3%25B6&datepicker=2016-09

I use mechanize to parse the website, it work fine at localhost, but after I deploy it to linode as a rails task, each times I run the rake command always get Mechanize::ResponseCodeError: 504 => Net::HTTPGatewayTimeOut

dont know how to resolve this problem

it works fine in localhst but cant work on linode server

require 'rubygems'
require 'mechanize'
  
agent = Mechanize.new
url = "http://e-service.cwb.gov.tw/HistoryDataQuery/MonthDataController.do?command=viewMain&station=467300&stname=%25E6%259D%25B1%25E5%2590%2589%25E5%25B3%25B6&datepicker=2016-09"
page = agent.get(url)
  • I wonder if t blocked by geo ip or similar. I cannot get Data from that site from here in the US either. So a guess would be that the website is blocking access from where linodes servers are located – Doon Sep 24 '16 at 13:33
  • can u try with `URI.unescape(url)` and then `page = agent.get(url)` – Santosh Sharma Sep 27 '16 at 05:28

0 Answers0