I want to retrieve the cookie value using this code, but failed
this is the result
any idea ???
VBA Code:
Function GetCookie(strUrl)
With CreateObject("WinHttp.WinHttpRequest.5.1")
.Open "GET", strUrl, False
.setRequestHeader "REFERER", strUrl
.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
.setRequestHeader "Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
.setRequestHeader "Accept-Language", "id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7"
.setRequestHeader "Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
.send
strCookie = .getAllResponseHeaders
strCookie = Split(strCookie, vbCrLf)
GetCookie = Trim(Split(Split(strCookie(5), ";")(0), ":")(1)) & "; " & Trim(Split(Split(strCookie(6), ";")(0), ":")(1))
End With
End Function
Sub get_cookies()
MsgBox (GetCookie("https://www.instagram.com"))
End Sub
this is the result
any idea ???