Как получить дату месяца из куки? - PullRequest
0 голосов
/ 29 января 2019

Сначала я делаю запрос на 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); 

1 Ответ

0 голосов
/ 29 января 2019

Не уверен, что это будет полезно или нет. Я использовал строковые функции для вашего запроса:

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)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...