Je cherche à compléter le code suivant afin d’ajouter « id="registrarData">Domain Name: autoitscript.com » parmi les éléments de recherche:
Global $file = @ScriptDir & "\code.ini", $search = "Registry Registrant ID: " pour que « Domain Name: autoitscript.com » soit
dans la liste.
Une autre question: Pourquoi "whois_email à la forme suivante :
« Registrant Email: 941:Registrant Email: <img src="/eimg/a/39/a3913c68f50559edd6e81cdf143cbbffca4b51d8.png" class="whois_email" alt="email">@1und1.de »
au lieux de : « Registrant Email: email@1und1.de ».
Merci d'avance pour votre aide
Cordialement.
Sleep(100)
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", "https://www.whois.com/whois/autoitscript.com", 0)
$oHTTP.Send()
$txt = $oHTTP.Responsetext
$oHTTP = 0
$txt2 = StringRegExpReplace($txt, '', "")
;Msgbox(0,"", $txt2)
FileWrite("code.ini", $txt2)
;~ Exit
;=============
Global $file = @ScriptDir & "\code.ini", $search = "Registry Registrant ID:"
Global $iLine = 0, $sLine = '', $iValid = 0
Global $hFile = FileOpen($file)
If $hFile = -1 Then
MsgBox(0,'ERROR','Unable to open file for reading.')
Exit 1
EndIf
; find the line that has the search string
While 1
$iLine += 1
$sLine = FileReadLine($hFile)
If @error = -1 Then ExitLoop
; test the line for the $search string until the flag $iValid is set
If StringInStr($sLine, $search) And Not $iValid Then
$iValid = 1
ContinueLoop
EndIf
If $iValid Then
$iValid += 1
;ConsoleWrite($iLine & ':' & $sLine & @CRLF)
; Msgbox(0,"", $sLine)
FileWrite("Résultat.ini", $iLine & ':' & $sLine & @CRLF)
If $iValid > 10 Then ExitLoop
EndIf
WEnd
FileClose($hFile)
Sleep(100)
FileDelete(@ScriptDir & "\code.ini")
Sleep(100)
;Exit
Local $file1 = @ScriptDir & "\Résultat.ini"
Local $inp = FileRead($file1)
Local $out = StringRegExpReplace($inp, '', '')
;~ ;MsgBox(0, "", $out)
$STR = $out
$STR = StringReplace($STR, "925:Registrant", " ")
$STR = StringReplace($STR, "926:Registrant", " ")
$STR = StringReplace($STR, "927:Registrant", " ")
$STR = StringReplace($STR, "928:Registrant", " ")
$STR = StringReplace($STR, "929:Registrant", " ")
$STR = StringReplace($STR, "930:Registrant", " ")
$STR = StringReplace($STR, "931:Registrant", " ")
$STR = StringReplace($STR, "932:Registrant", " ")
$STR = StringReplace($STR, "933:Registrant", " ")
$STR = StringReplace($STR, "934:Registrant", " ")
$STR = StringReplace($STR, "935:Registrant", " ")
$STR = StringReplace($STR, "936:Registrant", " ")
$STR = StringReplace($STR, "937:Registrant", " ")
$STR = StringReplace($STR, "938:Registrant", " ")
$STR = StringReplace($STR, "939:Registrant", " ")
$STR = StringReplace($STR, "940:Registrant", " ")
;MsgBox(0, "", $STR)
;Exit
;===============
;~ Local $file1 = @ScriptDir & "\Résultat.ini"
;~ Local $inp = FileRead($file1)
;~ Local $out = StringRegExpReplace($inp, '', '')
;~ $regex1 = "(?i)([1-9]+)\s*(:)\h*(Registrant)" ;"(?i)([1-9]+)\s*(:)\h*" ;"(?i)([a-z]+)\s*(:)\h*(.*)" ;"(?i).+Registrant:.*\v?" Registrant
;~ $txt1 = $out
;~ $txt1 = StringRegExpReplace($txt1, $regex1, "")
;~ msgbox(0,"2",$txt1)
;~ GUICtrlSetData($out, $txt1)
;~ Exit
;===============
;MsgBox(0, "", $STR)
;MsgBox(0, "Resultat", "Avant : "&$out&@CRLF&"Après : "&$STR)
FileWrite("Code.ini", $STR );$STR ;$txt1
FileDelete(@ScriptDir & "\Résultat.ini")
Sleep(100)
Exit