Submitting a post request to an aspx page

后端 未结 2 1155
星月不相逢
星月不相逢 2020-12-19 03:24

I have an ASPX page at https://searchlight.cluen.com/E5/CandidateSearch.aspx with a form on it, that I\'d like to submit and parse for information.

Using Python\'s

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-19 04:06

    I tried mechanize and urllib2, and mechanize handles cookies better. I can submit the form simply by specifying with mechanize:

        browser= mechanize.Browser()
        browser.select_form(form_name)
        browser.set_value("Page$Next", name="pagenumber")     
    

    It was not necessary to replicate the post request manually, and mechanize in this case was able to handle a form that relies on javascript.

提交回复
热议问题