我正在尝试编写一个代码,可以自动为您登录网页,但我无法找到提交的 url 变量。
如何找到提交登录的url变量?
即
https://login.fidelity.com/ftgw/Fas/Fidelity/RtlCust/Login/Init
当我在网站上提交用户名和密码时,它会将其传递到
https://login.fidelity.com/ftgw/Fas/Fidelity/RtlCust/Login/Response
用户名
<input>
有id="userId"
,密码<input>
有id="password"
,这一切都在有<form>
的
method="POST"
下
如何找到我需要提交的所有变量?
URL 变量并不总是在 URL 中。
大多数登录表单使用一种称为“POST”的数据传输方法。
用户看不到其中的URL数据。
您可以尝试使用 http://www.wireshark.org/ 或 http://www.charlesproxy.com/ 查看您的网络浏览器发送和接收的数据。
查找 URL 参数的名称(例如?username=....&pas=...)。 您可以查看该页面的 HTML。寻找类似这样的东西:
<form action="login.php" method="post">
<input type="text" name="username" value="User Types Username Here">
<input type="submit">
</form>
可以使用Chrome(Ctrl + Shift + J)网络工具。单击“保留日志”以确保在页面刷新之前捕获有效负载。