shenrenba 发表于 2014-9-28 18:03:57

关于获取cookie的问题(已解决)

本帖最后由 shenrenba 于 2014-9-29 08:02 编辑

使用WinHttp_GetRespond.udf获取的cookie不全,代码如下,如何解决?


#include "WinHttp_GetRespond.au3"
Local $cookie
Local $_t_url = "http://www.alimama.com/member/ajax_login.htm?forward=http%3A%2F%2Fwww.alimama.com%2F"
Local $MyOpen = _WinHttpOpen()
getcookie($_t_url)
_WinHttpCloseHandle($MyOpen)
Func getcookie($surl)
        Local $getcookie = _WinHTTP_GetRespond($MyOpen, $surl, 4 + 2 + 256, 5000)
        If @error Then Return
        MsgBox(0, 0, $getcookie)
EndFunc   ;==>getcookie

haijie1223 发表于 2014-9-28 20:30:10



似乎没有少吧,抓包和获取的是一样的啊~
#include <WinHttp.au3>
Global $hOpen, $hConnect, $hRequest, $sHeader
$hOpen = _WinHttpOpen()
$hConnect = _WinHttpConnect($hOpen, "www.alimama.com")
$hRequest = _WinHttpOpenRequest($hConnect, "POST", "/member/ajax_login.htm?forward=http%3A%2F%2Fwww.alimama.com%2F")
_WinHttpSendRequest($hRequest)
_WinHttpReceiveResponse($hRequest)
If _WinHttpQueryDataAvailable($hRequest) Then $sHeader = _WinHttpQueryHeaders($hRequest)
_WinHttpCloseHandle($hRequest)
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)
ConsoleWrite($sHeader & @CRLF)
MsgBox(0, "", $sHeader)

shenrenba 发表于 2014-9-29 08:01:37

回复 2# haijie1223


    我知道为什么不全了   单独这个页面的确是你这样但是加上前置页面cookie就多了3q
页: [1]
查看完整版本: 关于获取cookie的问题(已解决)