'Submit') loggedin_page = Login_form.submit(butt-6ren">
gpt4 book ai didi

ruby - 收到错误 "nil:NilClass (No MethodError)"

转载 作者:行者123 更新时间:2023-12-04 16:20:48 27 4
gpt4 key购买 nike

请找到代码的一部分:

button = Login_form.button_with(:name => 'Submit')
loggedin_page = Login_form.submit(button)


bizz_hierarchy_form=loggedin_page.form('login_showSplashForm')
button = bizz_hierarchy_form.button_with(:name => 'btnHome') #error raised here
# buyer_page = bizz_hierarchy_form.submit(button)
# print buyer_page.title

错误
D:\Ruby script>ruby Test.rb
mechanize.rb:20:in `<main>': undefined method `button_with' for nil:NilClass (No
MethodError)

D:\Ruby script>

html
<td>
<input type="submit" name="btnHome" value="Homepage" class="btnBig"><input type="hidden" name="_synchToken_hom" value="1139cc8dd7d906f1"/>
</td>

请帮我解决错误。

最佳答案

看起来像 form('login_showSplashForm')什么也没找到,尝试使用 form_with或者 forms.first

关于ruby - 收到错误 "nil:NilClass (No MethodError)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14447008/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com