当单击HTML按钮时,如何查看发出的POST请求的地址? [英] How to view the address of the POST request made when an HTML button is clicked?

查看:1277
本文介绍了当单击HTML按钮时,如何查看发出的POST请求的地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个涉及Web抓取和Web自动化的项目.我想先提交此表单( http://rgsntl.rgs .cuhk.edu.hk/rws_prd_applx2/Public/tt_dsp_timetable.aspx ),那么一旦您提交此表单,我想抓取出现的HTML页面.问题是我不确定如何通过Go程序提交此表单.

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.

我以前曾尝试使用Selenium来模拟Web浏览器,但现在我认为可能有一种更简单的方法.我认为我应该能够向该表单的提交"按钮发送到的地址发出POST请求,并直接使用返回的HTML页面.问题是我无法弄清楚如何获取提交按钮向POST请求发送的地址.我想问一下是否有一种方法可以监视单击按钮时向其发出POST请求的地址?另外,如果您发现我的想法有任何缺陷,请告诉我.谢谢.

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.

推荐答案

右键单击鼠标并选择检查选项.之后,选择网络"选项卡. 当您填写所有条目并单击提交按钮时,许多网址会闪烁.选择顶部网址,然后在标题标签下,您将看到POST方法的请求网址.

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.

查看图片

这篇关于当单击HTML按钮时,如何查看发出的POST请求的地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆