ruby gem mechanize for`fetch':405 =>网:: HTTPMethodNotAllowed

时间:2013-06-17 04:12:05

标签: ruby mechanize

我正在使用ruby的Mechanize gem登录网站。这就是我的问题:

require 'rubygems'
require 'mechanize'

agent = Mechanize.new
page = agent.get('http://mail.163.com/')
form = page.form('login163')
form.username = 'myaccount'
form.password = 'mypassword'
page = agent.submit(form)

当我运行脚本时,它无法工作,错误是:“在`fetch':405 => Net :: HTTPMethodNotAllowed for http://mail.163.com/”。我该怎么办?

0 个答案:

没有答案