我想使用命令行工具來登錄網站http://url/login.html 此頁沒有形式,但有三個輸入字段調用-WebRequst登錄網站
<div class="login-form">
<div class="phone-number">
<input id="account" type="text" placeholder="Account" />
</div>
<div class="code-input" style="position: relative;">
<input id="acc_pass" type="password" placeholder="Password" style="height:35px;" />
</div>
<p id="js_acc_error" style="color:red;margin-top:10px;"></p>
<div class="login-other">
<input id="account_login_checkbox" type="checkbox" /> <span>Read and agree<a class="show-xieyi" style="color:#3a74ba;cursor:pointer;"> EUL </a></span>
</div>
<div style="display:none; margin:4px 0 0 0;">
</div>
<div class="login-btn" style="margin:10px 0 0">
<button id="account_login_btn" type="submit">Login</button>
</div>
</div>
我用小提琴手捕獲請求後,點擊提交按鈕和重放請求使用捲曲,但有時不起作用,因爲cookie已更改。
所以我想使用命令填充輸入字段,然後單擊按鈕來重放請求。如何填寫字段並單擊Powershell Invoke-WebRequest或其他命令行工具中的按鈕?
謝謝。
我發現如何填寫字段$ WebResponse.InputFields.FindById('account')='username',但仍不知道如何提交此請求 –
這裏是頭信息:Accept:application/json, text/javascript,*/*; Q = 0.01 siteApiManager:假 X-請求-隨着:XMLHttpRequest的 的Referer:http://20.0.0.2/site3/e4db7920330c4b3f86700d35f080c5b6/login.html?_mp_cmp_ttime=1494465642965&weixin_tel_authed=false 接受語言:ZH-CN 接受 - 編碼:gzip的,放氣 的User-Agent:Mozilla的/ 5.0(Windows NT的10.0; WOW64;三叉戟/ 7.0; RV:11.0)等壁虎 主機:20.0.0.2 連接:保持活動 曲奇:maipu_uc_request_log_name = 39170; cmp_glb_param = 881f0923d82e3c3feb47aa5d69e7e337 –