我正在尝试使用 Mechanize 登录和抓取网站。
出于某种原因,我似乎无法让登录功能正常工作。有任何想法吗?
这是我的代码:
require 'nokogiri'
require 'open-uri'
require 'mechanize'
a = Mechanize.new
a.get('https://jackthreads.com/')
form = a.page.form_with(:class => 'jt-form')
form.field_with(:name => "email").value = "email"
form.field_with(:name => "password21").value = "password"
page = a.submit(form, form.buttons.first)