我正在使用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/”。我该怎么办?