如何获得一个月的Cookie中的日期?

问题描述 投票:0回答:1

首先,我做在google.com上一个请求。然后我得到的值。拉月份的日期。

 $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
 $oHTTP.Open("GET", "https://google.com", False);    
 $oHTTP.Send();
 $HeaderResponses = $oHTTP.GetAllResponseHeaders();   cookie
 ;$resp=$oHTTP.ResponseText;                           html
 $date = StringRegExpReplace($HeaderResponses, '/^(?!.*$)(.*)$/', '/^(?!.*$)(.*)$/'); get date
 FileWriteLine("test.txt", $date); 
autoit
1个回答
0
投票

不敢肯定这是否有用与否我已经使用字符串函数您的查询:

cpp
#include <StringConstants.au3>

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", "https://google.com", False)
$oHTTP.Send()

$HeaderResponses = $oHTTP.GetAllResponseHeaders() ; cookie
;$resp = $oHTTP.ResponseText                      ; html

$datepostionstart = StringInStr($HeaderResponses,"Date:")
$datepostionstend = StringInStr($HeaderResponses,"GMT")
$firstsring       = StringLeft($HeaderResponses,$datepostionstend-10)

MsgBox(1,"",$firstsring)

$date = StringTrimLeft($firstsring,$datepostionstart+10)

MsgBox(1,"",$date)

FileWriteLine("test.txt", "Cookie Date = "&$date)
© www.soinside.com 2019 - 2024. All rights reserved.