Mechanize :: ResponseCodeError:405 =>网:: HTTPMethodNotAllowed

时间:2016-12-19 12:49:23

标签: ruby-on-rails web-scraping mechanize

我正在尝试使用mechanize从网址中获取数据。

但是它给出了405错误

url = "http://switchboard.com/business?key=habitat%20magazine&where=10001"
agent.get(url)

错误:

Mechanize::ResponseCodeError: 405 => Net::HTTPMethodNotAllowed for http://switchboard.com/business?key=habitat%20magazine&where=10001 -- unhandled response

我正在使用带代理的机械化代理。出现此错误的原因是什么?我检查了其他SO问题,但没有人有答案。

0 个答案:

没有答案