【问题标题】:Trying to set the value of an input with mechanize尝试使用 mechanize 设置输入的值
【发布时间】:2015-06-08 17:34:54
【问题描述】:

我正在尝试将 html 页面中的输入设置为某个值。使用机械化,我正在写:

form.field_with(:name => 'lic_cno[0]') == "9511681"

但是当我在那之后写的时候

puts form.field_with(:name => 'lic_cno[0]').value

我的控制台中有一个空白区域。我做错了什么?

【问题讨论】:

  • 很抱歉,为什么会有"=="

标签: ruby input mechanize


【解决方案1】:

== 不就是测试值的意思吗? 不应该是

form.field_with(:name => 'lic_cno[0]') = "9511681"

【讨论】:

  • 我只使用一个时出现错误 = webscrapper.rb:101: syntax error, unexpected '=', expecting keyword_end form.field_with(:name => 'lic_cno[0]') = "9511681"
猜你喜欢
  • 1970-01-01
  • 2013-07-02
  • 2011-04-05
  • 2014-08-07
  • 2020-09-24
  • 2019-04-11
  • 2015-04-29
  • 2014-01-29
  • 1970-01-01
相关资源
最近更新 更多