$sText = '<div class="c1" title="3043"></div>'
$sText = StringRegExpReplace($sText, '.*<div class=".*" title="(.*?)">.*', '$1')
Msgbox(0, '', $sText)
<div class="field1 width160">Ранк</div>
<div class="field2"><div class="c1" title="3043"></div></div>
#include "WinHttp.au3"
#include "Array.au3"
Opt("MustDeclareVars", 1)
Global $hOpen = _WinHttpOpen()
Global $hConnect = _WinHttpConnect($hOpen, "ru.iccup.com")
Global $hRequest = _WinHttpOpenRequest($hConnect, Default, "dota/gamingprofile/kakawkin_ufa.html")
_WinHttpSendRequest($hRequest)
_WinHttpReceiveResponse($hRequest)
Global $sText = _WinHttpReadData($hRequest)
_WinHttpCloseHandle($hRequest)
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)
$sText = StringRegExpReplace($sText, '(?si)>Ранк<.*?<div\sclass="c1"\stitle="(\d+?)".*', '$1')
Msgbox(0, '', $sText)
так всё работает, как часы.как я выше писал
Код:Dim $sServerURL = 'http://ru.iccup.com/dota/gamingprofile/kakawkin_ufa.html' Dim $oHTTP = ObjCreate('winhttp.winhttprequest.5.1') $oHTTP.Open("GET", $sServerURL, True) $oHTTP.Send('') $oHTTP.WaitForResponse() $r=$oHTTP.ResponseText() $sText = StringRegExp($r, '\<div\hclass=\"c1\"\htitle=\"(\d+)\">',1) Msgbox(0, '', $sText[0])
потому что с регулярными выражениями не все работают. опыт программирования на определенном ЯП не делают их автоматически экспертами в регулярных выражениях. последнее, к слову, межязыковая парадигма.почему юзеры с большой репутацией, отписавшиеся выше, не могут грамотно написать выражение?
я то аутоит забросил полностью. на делфи перешёл!
Dim $sServerURL = 'http://ru.iccup.com/dota/gamingprofile/kakawkin_ufa.html'
Dim $oHTTP = ObjCreate('winhttp.winhttprequest.5.1')
$oHTTP.Open("GET", $sServerURL, True)
$oHTTP.Send('')
$oHTTP.WaitForResponse()
$r=$oHTTP.ResponseText()
$sText = StringRegExpReplace($r, '(?si)>Ранк<.*?<div \sclass="c1"\stitle="(\d+?)".*', '$1')
Msgbox(0, '', $sText)
Dim $sServerURL = 'http://ru.iccup.com/dota/gamingprofile/kakawkin_ufa.html'
Dim $oHTTP = ObjCreate('winhttp.winhttprequest.5.1')
$oHTTP.Open("GET", $sServerURL, True)
$oHTTP.Send('')
$oHTTP.WaitForResponse()
$r=$oHTTP.ResponseText()
$sText = StringRegExpReplace($r, '(?si).*>Ранк<.*?<div\sclass="c1"\stitle="(\d+?)".*', '$1')
Msgbox(0, '', $sText)
#include <GUIConstants.au3>
GUICreate("Bot stats detected")
Opt("GUICoordMode",3)
GUICtrlCreateLabel ("Ник мудилы",64,8,74,17)
$nick = GUICtrlCreateEdit ("",40,32,121,21)
$Check = GUICtrlCreateButton ("Чекнуть",40,64,123,25)
$pts = GUICtrlCreateLabel ("ПТС:",40,96,71,17)
$stats = GUICtrlCreateLabel ("Стата:",40,120,100,17)
$livers = GUICtrlCreateLabel ("Ливы:",40,144,71,17)
GUISetState ()
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then
ExitLoop
ElseIf $msg = $check Then
$pidor = GuiCtrlRead($nick)
Dim $sServerURL = 'http://ru.iccup.com/dota/gamingprofile/' & $pidor & '.html'
Dim $oHTTP = ObjCreate('winhttp.winhttprequest.5.1')
$oHTTP.Open("GET", $sServerURL, True)
$oHTTP.Send('')
$oHTTP.WaitForResponse()
$r=$oHTTP.ResponseText()
$sText1 = StringRegExp($r, '(?si)>Ранк<.*?<div\sclass="(.*?)"\stitle="(\d+?)".*',1)
GUICtrlSetData ($pts,"ПТС: " & $sText1[1])
$sText = StringRegExp($r, '(?si)>Статистика<.*?<div\sclass="field2">(.*?)</div>',1)
GUICtrlSetData ($stats,"Стата: " & $sText[0])
$sText = StringRegExp($r, '(?si)>Кол-во ливов<.*?<div\sclass="field2">(.*?)</div>',1)
GUICtrlSetData ($livers,"Ливы: " & $sText[0])
EndIf
Wend
всегда предпочитал winhttpЗачем вам вообще для метода GET понадобился объект: winhttp.winhttprequest.5.1?