我想使用python mechanize填写此页上的表单,然后记录响应。我该怎么做?当我使用以下代码在此页上搜索表单时,它只显示用于搜索的表单。我应该如何定位其他表单的表单名称以及名称、性别等字段?
http://aapmaharashtra.org/join-us
代码:
import mechanize
br=mechanize.Browser()
br.open("http://aapmaharashtra.org/join-us")
for form in br.forms():
print "Form name:", form.name
print form
您需要的表单(带有
id="form1"
)是动态加载的,这就是为什么您在select_forms()
结果中看不到它。通过使用浏览器开发工具,您可能会发现表单是从
http://internal.aamaadmiparty.org/Directory/Format.aspx?master=blank
链接加载的。你应该从以下几点开始:
希望能有所帮助。
相关问题 更多 >
编程相关推荐