我有一个带有<input type="button" name="submit" />
按钮的表单,希望能够单击它。
我已经尝试过mech.form.click("submit")
,但这给出了以下错误:
ControlNotFoundError: no control matching kind 'clickable', id 'submit'
mech.submit()
也不起作用,因为它的类型是按钮而不是提交。
有任何想法吗?谢谢。
type="button"
在纯 html表单中单击 a什么也不做。为了让它做任何事情,必须有javascript参与。
并且mechanize
不运行javascript。
所以你的选择是:
mechanize
它会做什么spidermonkey
运行 javascript 代码我会做第一个,因为使用spidermonkey
似乎很难而且可能不值得。