只能是打開電腦本身的ie瀏覽器,不能是使用webbrower等控制元件。
建立了一個對話框程式
在OnInitDialog()
使用IE打開對應的網頁
ShellExecute(NULL, _T("open"), _T("IExplore.exe"), _T("http://dddl.gs.tax.cn/js_sso_server/login?service=http%3A%2F%2Fportal.gs.tax.cn%2Fwelcome.html"), NULL, SW_SHOW);
之前使用抓包工具fiddler2
1、瀏覽器打開http://dddl.gs.tax.cn/js_sso_server/login?service=http%3A%2F%2Fportal.gs.tax.cn%2Fwelcome.html
get 請求,回傳cookie: JSESSIONID=lQPxxxxxxxxxxxxxxxxxxxxxxxxxxxx!-1168173757
2、輸入用戶名和密碼,點擊表單登錄按鈕
post請求,網址http://dddl.gs.tax.cn/js_sso_server/login;jsessionid=lQPxxxxxxxxxxxxxxxxxxxxxxxxxxxx!-1168173757?service=http%3A%2F%2Fportal.gs.tax.cn%2Fwelcome.html
就是訪問地址加上了jsessionid
cookie: JSESSIONID=lQPxxxxxxxxxxxxxxxxxxxxxxxxxxxx!-1168173757
username=xx&password=xx&brower=xx&ip=xx&hostname=xx&app=service%Dhttp%2A%2F%2Fportal.gs.tax.cn%2Fwelcome.html&yzm=&swrydm=<=LT-145174-XXXXXX0j&execution=e1s1&_eventId=submit&submit=%E7%99%BB%E5%BD%95
之前已經也已經獲取登錄網頁的原始碼,是一個表單<FORM></FORM>
表單id是fm1,
兩個文本輸入框 input type="text"
id分別是 username和password,初始value取值為空
一個提交按鈕<input type="submit" value="https://bbs.csdn.net/topics/登錄" />,name="submit",沒有id,
如何自動提交表單
有哪幾種方法實作?
uj5u.com熱心網友回復:
vbs腳本 ajax?uj5u.com熱心網友回復:
把編輯框中的內容作為網址引數再打開一次,模擬提交按鈕uj5u.com熱心網友回復:
只能使用系統本身的ie瀏覽器。代碼遍歷ie瀏覽器中的元素
uj5u.com熱心網友回復:
用COM組件,有個操作IE DOM的介面,你百度一下,我做過的。uj5u.com熱心網友回復:
先用抓包工具抓包,然后用CURL工具命令列,按指令執行就好。uj5u.com熱心網友回復:
1、首先添加com組件的參考加入對Microsoft Internet Controls的參考;
加入對Microsoft HTML Object Library的參考;(其實就是mshtml)
uj5u.com熱心網友回復:
python已經解決。轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/79657.html
標籤:網絡編程
上一篇:【各路菊苣、萵苣、神仙速進!斑竹、4哥...說的就是你】
下一篇:DirectShow視頻錄像問題
