how to submit query to .aspx page in python

前端 未结 5 1671

I need to scrape query results from an .aspx web page.

http://legistar.council.nyc.gov/Legislation.aspx

The url is static, so how do I submit a query to thi

5条回答
  •  星月不相逢
    2020-12-02 15:14

    Most ASP.NET sites (the one you referenced included) will actually post their queries back to themselves using the HTTP POST verb, not the GET verb. That is why the URL is not changing as you noted.

    What you will need to do is look at the generated HTML and capture all their form values. Be sure to capture all the form values, as some of them are used to page validation and without them your POST request will be denied.

    Other than the validation, an ASPX page in regards to scraping and posting is no different than other web technologies.

提交回复
热议问题