При выполнении, не сразу, а через повторений 80 выходит ошибка
"C:\Program Files\AutoIt3\Include\IE.au3" (1811) : ==> The requested action with this object has failed.:
Return SetError($_IESTATUS_Success, $oTemp.GetElementsByTagName($sTagName).length, $oTemp.GetElementsByTagName($sTagName))
Return SetError($_IESTATUS_Success, $oTemp^ ERROR
как ее исправить, или сделать, что бы не ошибка выскакивала а просто закрывалась программа?
"C:\Program Files\AutoIt3\Include\IE.au3" (1811) : ==> The requested action with this object has failed.:
Return SetError($_IESTATUS_Success, $oTemp.GetElementsByTagName($sTagName).length, $oTemp.GetElementsByTagName($sTagName))
Return SetError($_IESTATUS_Success, $oTemp^ ERROR
как ее исправить, или сделать, что бы не ошибка выскакивала а просто закрывалась программа?
Код:
#include <IE.au3>
#include <file.au3>
#include <Date.au3>
#include <MsgBoxConstants.au3>
$sUrl= 'https://elitedrop.ru/'
$i = 1
;~ TraySetIcon ( [ filename [, iconID ]] )
$oIE = _IECreate($sUrl, 0, 1, 0)
_IELoadWaitTimeout()
_IELoadWait($oIE)
while 1
;~ +++++++++++Считываем приведущий промокод+++++++++++
$fo = fileopen (@ScriptDir & "\text.txt",0)
$fr = FileRead ($fo)
FileClose ($fo)
;~ -----------Считываем приведущий промокод-----------
;~ +++++++++++Считываем промокод с сайта+++++++++++
$sText = ""
$elems = _IETagNameGetCollection($oIE, "input")
If IsObj($elems) Then
For $elem In $elems
If StringInStr($elem.className, "input-promo-code") Then
$sText = $elem.value
ExitLoop
EndIf
Next
EndIf
;~ -----------Считываем промокод с сайта-----------
ToolTip ($sText & @CRLF & "Обновлено " & $i & " раз",0,0,"Промокод")
if $sText = "" then
else
if $fr = $sText then
$r = 2000
;~ $r = Random (60000, 120000 ,1)
;~ $r = Random (2000, 5000 ,1)
Sleep ($r)
_IEAction($oIE, "refresh")
else
$fo = fileopen (@ScriptDir & "\text.txt",2)
FileWrite ($fo,$sText)
FileClose ($fo)
$date = @MDAY & "." & @MON & "." & @YEAR & " " & @HOUR & ":" & @MIN & " " & $sText & @CRLF
$f1 = fileopen (@ScriptDir & "\log.txt",1)
FileWrite ($f1,$date)
FileClose ($f1)
_IENavigate ($oIE, "https://elitedrop.ru/profile/sid-401406", 1)
$oPost = _IEGetObjById ($oIE,"bonus_code") ;<=== получаем Obj по ID "post_field"
if @error Then
Exit
EndIf
_IEAction ($oPost,"focus") ;<==== Устанавливаем фокус на обьекте
if @error Then
Exit
EndIf
_IEFormElementSetValue($oPost, $sText) ;<==== устанавливаем новое значение
if @error Then
Exit
EndIf
$oButtons = _IETagNameGetCollection($oIE, 'button')
if @error Then
Exit
EndIf
For $oButton In $oButtons
If $oButton.classname == "btn-gr" Then
$oButton.Click()
ExitLoop
EndIf
Next
_IENavigate ($oIE, "https://elitedrop.ru/",1)
if @error Then
Exit
EndIf
EndIf
EndIf
$i = $i + 1
WEnd