How to view the address of the POST request made when an HTML button is clicked?

南楼画角 提交于 2020-04-16 05:42:13

问题


I am creating a project involving web scraping and web automation. I would like to first submit this form (http://rgsntl.rgs.cuhk.edu.hk/rws_prd_applx2/Public/tt_dsp_timetable.aspx) then once you submit this form, I want to scrape the HTML page that comes up. The problem is I am not sure how to submit this form through a Go program.

I was previously experimenting with Selenium to emulate a web browser but now I think there may be an easier way. I think that I should be able to make a POST request to the same address that the "submit" button of this form makes to and directly use the HTML page that is returned. The problem is that I cannot figure out how to get the address that the submit button makes a POST request to. I would like to ask if there is a way to monitor the address that the button makes a POST request to when it is clicked? Also if you see any flaws with my idea please do let me know. Thank you.


回答1:


Right click mouse and select inspect option. After that select the Network tab. When you fill all the entries and click submit button many urls flashes. Select the top url and under the headers tab you will see the request url for POST method.

preview

See the image



来源:https://stackoverflow.com/questions/56721361/how-to-view-the-address-of-the-post-request-made-when-an-html-button-is-clicked

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