Mechanize在所需的websi中找不到任何表单

2024-05-14 21:24:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试填写网站中的所有表格: https://breast.predict.nhs.uk/tool

进口机械化

br = mechanize.Browser()
br.set_handle_robots(False) #ignore robots.txt
br.open("https://breast.predict.nhs.uk/tool")
print(br.forms())

输出为空列表,br.select_form(nr=0)会出现以下错误:

File " line 18, in <module>
br.select_form(nr=0)
line 668, in select_form
raise FormNotFoundError("no form matching " + description)
mechanize._mechanize.FormNotFoundError: no form matching nr 0

我知道这个网站上有表格,所以我遗漏了什么

谢谢你的帮助


Tags: httpsbrform网站linetoolselectpredict

热门问题