我想填写 www.vegas.com/lasvegastraveldeals 的日历日期字段。
到目前为止,我似乎无法使该value
方法起作用。这是我的代码:
require 'mechanize'
agent = Mechanize.new
page = agent.get('http://www.vegas.com/lasvegastraveldeals/')
vegas_form = page.form('gs')
vegas_form.q = 'DFW'
departure = vegas_form.field_with(:id => 'departureDatec12')
departure.value = "05/16/2014"
pp page
我收到此错误:
vegas_scraper.rb:9:in `<main>': undefined method `value=' for nil:NilClass (NoMethodError)
有什么建议么?