机械化带有禁用按钮的python提交表单

时间:2019-04-15 18:01:04

标签: python python-3.x

这是我的代码:

br = mechanize.Browser()
cj = cookiejar.CookieJar()
br.set_cookiejar(cj)
br.open('xxx.com')
login_form = br.select_form(nr=0)

br.form['comment'] = 'something here'

br.submit()

但是问题是提交按钮的属性为disable =“ disabled” 当您在注释输入中输入内容时,此禁用的attr会在页面上使用一些js代码消失(但机械化不支持此功能)-并且它不会提交表单

我该怎么办? 我试图禁用此功能,但没有帮助:

br.form.controls[2].disabled=False

0 个答案:

没有答案