#include <IE.au3>
For $i = 1 To 1
$oIE = _IECreate('http://www.google.ru/')
If @error Then ExitLoop
$oForm = _IEGetObjById($oIE, 'f')
If @error Then ExitLoop
$oInput = _IEFormElementGetObjByName($oForm, 'q')
If @error Then ExitLoop
_IEFormElementSetValue($oInput, 'autoit-script.ru')
If @error Then ExitLoop
_IEFormSubmit($oForm)
If @error Then ExitLoop
$oLinks = _IELinkGetCollection($oIE)
If @error Then ExitLoop
For $oLink In $oLinks
If StringInStr(_IEPropertyGet($oLink, 'innertext'), 'Главная страница') Then
$oLink.target = '_self';закомментируйте
_IEAction($oLink, 'click')
If @error Then ExitLoop 2
_IELoadWait($oIE)
If @error Then ExitLoop 2
ExitLoop
EndIf
Next
Next
If @error Then
_IEQuit($oIE)
MsgBox(16, 'Error', 'Error')
Exit -33
EndIf
MsgBox(64, 'Info', 'OK')