0
我想使用机械化做一个红宝石脚本,所以我可以登录到Tumblr。我有以下脚本:根据机械化网站应该工作Tumblr登录脚本与机械化
require 'rubygems'
require 'mechanize'
def get_page link
agent = Mechanize.new
page = agent.get(link)
end
def login email, pass
login_page = get_page 'https://www.tumblr.com/login'
dash = login_page.form_with(:action => 'https://www.tumblr.com/svc/account/register') do |f|
f.fields[0] = email
f.fields[1] = pass
end.click_button
dash
end
此代码,但我总是得到这个错误:
/Users/me/.rvm/gems/ruby-2.0.0-p0/gems/mechanize-2.7.1/lib/mechanize/form.rb:312:in `block in save_hash_field_order': undefined method `node' for "[email protected]":String (NoMethodError)
谁能帮助我?或者如果已经有这样一个脚本,你能指出我吗? (我没有找到任何)