как перейти именно по этой ссылке?
#include <IE.au3>
$oIE = _IECreate('ваш адрес')
_IELinkClickByText($oIE,"Нетбук")
_IENavigate($oIE, "https://www.lmlab.ru/inside/actions/retention/index.shtml")
_IELoadWait_()
WinSetTitle($Form1, "", $Title&" - 1-й переход - ОК")
Sleep (100)
_IENavigate($oIE, "https://www.lmlab.ru/inside/actions/retention/prizes.shtml")
_IELoadWait_()
WinSetTitle($Form1, "", $Title&" - 2-й переход - ОК")
Sleep (100)
_IENavigate($oIE, "https://www.lmlab.ru/inside/actions/retention/prizes.shtml")
_IELoadWait_()
_IELinkClickByText($oIE,"Нетбук")
Можно как-то вывести в окне отделном или в тайтле основного окна адрес страницы на которой сейчас находимся?!
MsgBox(0,_IEPropertyGet($oIE, "locationname"),_IEPropertyGet($oIE, "locationurl"))
_IENavigate($oIE, "https://www.lmlab.ru/inside/actions/retention/index.shtml")
WinSetTitle($Form1, "", $Title&" - 1-й переход - ОК")
Sleep (100)
_IENavigate($oIE, "https://www.lmlab.ru/inside/actions/retention/prizes.shtml")
WinSetTitle($Form1, "", $Title&" - 2-й переход - ОК")
Sleep (100)
_IELinkClickByText($oIE, "Нетбук")
WinSetTitle($Form1, "", $Title&" - 3-й переход - ОК")
MsgBox(0,_IEPropertyGet($oIE, "locationname"),_IEPropertyGet($oIE, "locationurl"))
Sleep (100)
<a href="./prize.shtml?prize=3431d95248f57fb0e1c6502c449ecc2c">
<img src="https://www.lmlab.ru/p/images/ssl_2010/retention/prizes/lmlab_ru_retention_netbook.png" class="png" width="120" height="110" alt="">
<span>Нетбук</span>
</a>
_IENavigate($oIE, "https://www.lmlab.ru/inside/actions/retention/index.shtml")
WinSetTitle($Form1, "", $Title&" - 1-й переход - ОК")
Sleep (100)
_IENavigate($oIE, "https://www.lmlab.ru/inside/actions/retention/prizes.shtml")
WinSetTitle($Form1, "", $Title&" - 2-й переход - ОК")
Sleep (100)
$oTags = _IETagNameGetCollection($oIE, "span")
For $oTag In $oTags
If _IEPropertyGet($oTag, "innertext") = "Нетбук") Then
_IEAction($oTag, "click")
EndIf
Next
WinSetTitle($Form1, "", $Title&" - 3-й переход - ОК")
MsgBox(0,_IEPropertyGet($oIE, "locationname"),_IEPropertyGet($oIE, "locationurl"))
Sleep (100)
В начале кода поставьте:gunlinger сказал(а):собственно вопрос как их правильно обьявить?
Dim $переменная
#include <IE.au3>
#include <ProgressConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
Opt("MustDeclareVars", 1)
OnAutoItExitRegister( "_Exit" )
_IELoadWaitTimeout (15000)
Dim $Login = ""
Dim $Password = ""
Dim $oTags
Dim $oTag
Global $oIE, $Timer, _
$TimerUpdate2 = 0, _
$Logged
Global $Version = "0.1", $Title = "LM-loginer"&$Version
$oIE = _IECreate ("",0,0)
Dim $SinkObject=ObjEvent($oIE,"IEEvent_","DWebBrowserEvents2")
#Region ### START Koda GUI section ### Form=
Dim $Form1 = GUICreate($Title, 400, 250)
Dim $Button1 = GUICtrlCreateButton("Login", 0, 224, 57, 25)
Dim $Button2 = GUICtrlCreateButton("Logoff", 56, 224, 65, 25)
Dim $Progress1 = GUICtrlCreateProgress(120, 224, 280, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Local $nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
WinSetTitle($Form1, "", $Title&" - Загрузка...")
$Logged = Login()
If $Logged Then
MsgBox(0,"","All Right!")
WinSetTitle($Form1, "", $Title&" - Залогинены...")
Else
MsgBox(0,"","Какая-то ошибка при логине")
EndIf
Case $Button2
Logoff()
EndSwitch
If $Logged Then
Serf1()
EndIf
WEnd
Func _IELoadWait_()
_IELoadWait($oIE)
If @error = 6 Then
MsgBox(16, "_IELoadWait_ #Error: "&@error, "Время ожидания отклика страницы истекло")
SetError(@error)
ElseIf @error <> 6 And @error <> 0 Then
MsgBox(16, "_IELoadWait_ #Error: "&@error, "Ошибка "&@error)
SetError(@error)
ElseIf @error = 0 Then
Return True
EndIf
Return False
EndFunc
Func Login()
_IENavigate($oIE, "https://www.lmlab.ru")
_IELoadWait_()
If IsLogin() Then
Return True
Else
Local $oForm = _IEFormGetObjByName ($oIE, 0)
Local $oLogin = _IEFormElementGetObjByName ($oForm, "Login")
Local $oPassword = _IEFormElementGetObjByName ($oForm, "Password")
_IEFormElementSetValue ($oLogin, $Login)
_IEFormElementSetValue ($oPassword, $Password)
_IEFormSubmit ($oForm)
If @error Then
MsgBox(16, "Login #Error: "&@error, "Неудалось залогиниться") ;ФАКАП
Return False
EndIf
_IELoadWait_()
Return True
EndIf
EndFunc
Func IEEvent_ProgressChange($Progress,$ProgressMax)
Local $percent = Int( ($Progress * 100) / $ProgressMax )
If $percent >= 0 And $percent <= 100 Then
GUICtrlSetData($progress1,$percent)
EndIf
EndFunc
Func Logoff()
_IENavigate($oIE, "https://www.lmlab.ru/inside/logout.shtml")
_IELoadWait_()
$Logged = False
WinSetTitle($Form1, "", $Title&" - Разлогинены")
EndFunc
Func IsLogin()
If _IEGetObjById ($oIE, "profile") = 0 Then Return False
Return True
EndFunc
Func Serf1()
_IENavigate($oIE, "https://www.lmlab.ru/inside/actions/retention/index.shtml")
WinSetTitle($Form1, "", $Title&" - 1-й переход - ОК")
Sleep (100)
_IENavigate($oIE, "https://www.lmlab.ru/inside/actions/retention/prizes.shtml")
WinSetTitle($Form1, "", $Title&" - 2-й переход - ОК")
Sleep (100)
$oTags = _IETagNameGetCollection($oIE, "span")
For $oTag In $oTags
If _IEPropertyGet($oTag, "innertext") = "Нетбук") Then
_IEAction($oTag, "click")
EndIf
Next
WinSetTitle($Form1, "", $Title&" - 3-й переход - ОК")
MsgBox(0,_IEPropertyGet($oIE, "locationname"),_IEPropertyGet($oIE, "locationurl"))
Sleep (100)
EndFunc
Func _Exit()
_IEQuit ($oIE)
EndFunc
Func Serf1()
_IENavigate($oIE, "https://www.lmlab.ru/inside/actions/retention/index.shtml")
WinSetTitle($Form1, "", $Title&" - 1-й переход - ОК")
Sleep (100)
_IENavigate($oIE, "https://www.lmlab.ru/inside/actions/retention/prizes.shtml")
WinSetTitle($Form1, "", $Title&" - 2-й переход - ОК")
Sleep (100)
$oTags = _IELinkClickByText($oIE, "span")
For $oTag In $oTags
If _IEPropertyGet($oTag, "innertext") = "Нетбук" Then
_IEAction($oTag, "click")
EndIf
Next
WinSetTitle($Form1, "", $Title&" - 3-й переход - ОК")
MsgBox(0,_IEPropertyGet($oIE, "locationname"),_IEPropertyGet($oIE, "locationurl"))
Sleep (100)
EndFunc
#include <IE.au3>
#include <ProgressConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
Opt("MustDeclareVars", 1)
OnAutoItExitRegister( "_Exit" )
_IELoadWaitTimeout (15000)
Dim $Login = "[email protected]"
Dim $Password = "icFdYtYo"
Dim $oTags
Dim $oTag
Global $oIE, $Timer, _
$TimerUpdate2 = 0, _
$Logged
Global $Version = "0.1", $Title = "LM-loginer"&$Version
$oIE = _IECreate ()
Dim $SinkObject=ObjEvent($oIE,"IEEvent_","DWebBrowserEvents2")
#Region ### START Koda GUI section ### Form=
Dim $Form1 = GUICreate($Title, 400, 250)
Dim $Button1 = GUICtrlCreateButton("Login", 0, 224, 57, 25)
Dim $Button2 = GUICtrlCreateButton("Logoff", 56, 224, 65, 25)
Dim $Progress1 = GUICtrlCreateProgress(120, 224, 280, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Local $nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
WinSetTitle($Form1, "", $Title&" - Загрузка...")
Login()
If @error Then
MsgBox(0,@error,"All Right!")
WinSetTitle($Form1, "", $Title&" - Залогинены...")
$Logged = 1
Else
MsgBox(0,@error,"Какая-то ошибка при логине")
EndIf
Case $Button2
Logoff()
EndSwitch
If $Logged Then
Serf1()
EndIf
WEnd
Func Login()
_IENavigate($oIE, "https://www.lmlab.ru")
IsLogin()
If Not @error Then
Local $oForm = _IEFormGetObjByName ($oIE, 0)
Local $oLogin = _IEFormElementGetObjByName ($oForm, "Login")
Local $oPassword = _IEFormElementGetObjByName ($oForm, "Password")
_IEFormElementSetValue ($oLogin, $Login)
_IEFormElementSetValue ($oPassword, $Password)
_IEFormSubmit ($oForm)
If @error Then
MsgBox(16, "Login #Error: "&@error, "Неудалось залогиниться") ;ФАКАП
Return SetError(0)
EndIf
EndIf
Return SetError(1)
EndFunc
Func IEEvent_ProgressChange($Progress,$ProgressMax)
Local $percent = Int( ($Progress * 100) / $ProgressMax )
If $percent >= 0 And $percent <= 100 Then
GUICtrlSetData($progress1,$percent)
EndIf
EndFunc
Func Logoff()
_IENavigate($oIE, "https://www.lmlab.ru/inside/logout.shtml")
WinSetTitle($Form1, "", $Title&" - Разлогинены")
Return SetError(0)
EndFunc
Func IsLogin()
Local $oLinks
$oLinks = _IELinkGetCollection ($oIE)
For $oLink In $oLinks
If _IEPropertyGet($oLink,"innerText") = "Выход" Then
Return SetError(1,"", _IEPropertyGet($oLink,"innerText"))
ExitLoop
EndIf
Next
Return SetError(0)
EndFunc
Func Serf1()
_IENavigate($oIE, "https://www.lmlab.ru/inside/actions/retention/index.shtml")
WinSetTitle($Form1, "", $Title&" - 1-й переход - ОК")
Sleep (100)
_IENavigate($oIE, "https://www.lmlab.ru/inside/actions/retention/prizes.shtml")
WinSetTitle($Form1, "", $Title&" - 2-й переход - ОК")
Sleep (100)
$oTags = _IETagNameGetCollection($oIE, "span")
For $oTag In $oTags
If _IEPropertyGet($oTag, "innertext") = "Нетбук" Then
_IEAction($oTag, "click")
EndIf
Next
WinSetTitle($Form1, "", $Title&" - 3-й переход - ОК")
MsgBox(0,_IEPropertyGet($oIE, "locationname"),_IEPropertyGet($oIE, "locationurl"))
Sleep (100)
EndFunc
Func _Exit()
_IEQuit ($oIE)
EndFunc
Забавно кстати, раньше все работало в фоне, а теперь зараза окно эксплорера открывает )
$oIE = _IECreate ("about:blank", 0, 0)
На нужную страницу он переходит, но адрес выдает всеравно неверный
_IEAction($oTag, "click")
_IELoadWait ($oIE)
Тогда вам сюда Стол заказов ;)Теперь второй интересный пункт задачи. Нужен небольшой анализ страницы.