我尝试使用mechanize(Ruby)访问表单.在我的表格上,我有一个Radiobuttons的gorup.所以我想检查其中一个.
我写:
target_form = (page/:form).find{ |elem| elem['id'] == 'formid'}
target_form.radiobutton_with(:name => "radiobuttonname")[2].check
Run Code Online (Sandbox Code Playgroud)
在这一行中,我想检查值为2的单选按钮.但在这一行中,我收到一个错误:
: undefined method `radiobutton_with' for #<Nokogiri::XML::Element:0x9b86ea> (NoMethodError)
Run Code Online (Sandbox Code Playgroud)