alex33
Скриптер
- Сообщения
- 1,457
- Репутация
- 186
Здравствуйте. Хотел написать скрипт для автоматической регистрации на сайте regref.ru.
Написал кажется правильно, но не работает. Не пойму в чём проблема.
Вот кусок кода, подскажите что не так.
После выполнения скрипта в консоль пишет следующее:
Написал кажется правильно, но не работает. Не пойму в чём проблема.
Вот кусок кода, подскажите что не так.
Код:
_IELoadWaitTimeout(5000)
$oIE = _IECreate($sRefURL); переход по реферальной ссылке
If Not IsObj($oIE) Then Return SetError(1)
_IENavigate($oIE, "http://regref.ru/signup", 0); переход на страницу регистрации
Local $bFlag=False; флаг ошибки
For $k = 1 To 10; цикл для ожидания
$oLogin = _IEGetObjByName($oIE, "login")
$oEmail = _IEGetObjByName($oIE, "email")
$oPass = _IEGetObjByName($oIE, "pass")
$oRepass = _IEGetObjByName($oIE, "repass")
$oRules = _IEGetObjByName($oIE, "rules")
$oRegistr = _IEGetObjByName($oIE, "registr")
If IsObj($oLogin) And IsObj($oEmail) And IsObj($oPass) And IsObj($oRepass) And IsObj($oRules) And IsObj($oRegistr) Then; если все элементы найдены
$bFlag=True; ошибок нет
ExitLoop
EndIf
Sleep(1000)
Next
If Not $bFlag Then Return SetError(3); если флаг false - ошибка
_IEFormElementSetValue($oLogin, $aRegFormData[0])
_IEFormElementSetValue($oEmail, $aRegFormData[1])
_IEFormElementSetValue($oPass, $aRegFormData[2])
_IEFormElementSetValue($oRepass, $aRegFormData[2])
If IsObj($oRules) Then $oRules.checked=1; ставим флажок в правилах
_IEAction($oRegistr, "click"); клик по кнопке зарегистрироваться
Код:
>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\Alexey\Documents\1_regref\1.au3" /UserParams
+>09:31:15 Starting AutoIt3Wrapper v.2.2.0.3 SciTE v.3.4.1.0 Keyboard:00000419 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86 Environment(Language:0419)
+> SciTEDir => C:\Program Files\AutoIt3\SciTE UserDir => C:\Users\Alexey\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\Alexey\AppData\Local\AutoIt v3\SciTE
>Running AU3Check (3.3.12.0) from:C:\Program Files\AutoIt3 input:C:\Users\Alexey\Documents\1_regref\1.au3
+>09:31:15 AU3Check ended.rc:0
>Running:(3.3.12.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Users\Alexey\Documents\1_regref\1.au3"
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: login, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: email, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: repass, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: rules, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: registr, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: login, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: email, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: repass, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: rules, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: registr, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: login, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: email, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: repass, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: rules, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: registr, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: login, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: email, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: repass, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: rules, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: registr, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: login, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: email, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: repass, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: rules, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: registr, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: login, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: email, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: repass, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: rules, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: registr, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: login, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: email, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: repass, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: rules, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: registr, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: login, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: email, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: repass, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: rules, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: registr, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: login, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: email, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: repass, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: rules, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: registr, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: login, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: email, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: repass, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: rules, Index: 0)
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: registr, Index: 0)
@error code: 3
+>09:31:27 AutoIt3.exe ended.rc:0
+>09:31:27 AutoIt3Wrapper Finished.
>Exit code: 0 Time: 12.12