【发布时间】:2016-02-14 06:01:39
【问题描述】:
我正在尝试在网站中提交表单,当我运行代码时,它给了我错误:
mechanize._form.ParseError: 嵌套表单
所以我查了一下,在网站上,有 2 个表格在彼此内部。 我需要的第一个表单已正确关闭。
有没有办法解决这个问题?
【问题讨论】:
我正在尝试在网站中提交表单,当我运行代码时,它给了我错误:
mechanize._form.ParseError: 嵌套表单
所以我查了一下,在网站上,有 2 个表格在彼此内部。 我需要的第一个表单已正确关闭。
有没有办法解决这个问题?
【问题讨论】:
br.select_form(name = "frmName") if name of the form is stated, otherwise
br.select_form(nr=0) which means you are accessing the first form with index 0(nr=0)
【讨论】:
br.select_form(predicate=lambda f: f.attrs.get('id', None) == 'email-form') 这可能有助于您选择表格的功能..
【讨论】: