Sending form data to aspx page

你离开我真会死。 提交于 2019-12-05 07:46:56

took advice from @pguardiario and went the mechanize route... much simpler

    import mechanize

    url = r'http://www.cpso.on.ca/docsearch/'
    request = mechanize.Request(url)
    response = mechanize.urlopen(request)
    forms = mechanize.ParseResponse(response, backwards_compat=False)
    response.close()

    form = forms[0]

    form['ctl00$ContentPlaceHolder1$MainContentControl1$ctl00$txtLastName']='Smith'
    form['ctl00$ContentPlaceHolder1$MainContentControl1$ctl00$txtPostalCode']='K1H'

    print mechanize.urlopen(form.click()).read()

I am a long way from finishing, but this is getting me a lot further.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!