autoit2008 Posted September 7, 2008 Share Posted September 7, 2008 I want to automate IE, after submitting a value on the first page, and cilck on some link on the next page after the submission. Here is my code: #include <IE.au3> #include <Debug.au3> _DebugSetup ("Google-click next") $oIE = _IECreate("http://www.google.com") _DebugOut ("Start....") $o_form = _IEFormGetObjByName($oIE, "f") $o_q = _IEFormElementGetObjByName($o_form, "q") $o_submit = _IEFormElementGetObjByName($o_form, "btnG") _IEFormElementSetValue($o_q, "test") _IEAction($o_submit, "click") _DebugOut("next page"); $sMyString = "Next" $oLinks = _IELinkGetCollection($oIE) For $oLink in $oLinks $sLinkText = _IEPropertyGet($oLink, "innertext") If StringInStr($sLinkText, $sMyString) Then _IEAction($oLink, "click") ExitLoop EndIf Next _DebugOut ("End....") The initial form submission works, but it doesn't click on the next page. For clicking next page, I tried with this also: _IELinkClickByText($oIE, "Next", 1) But still doesn't work. Does anyone know why? Thanks! Link to comment Share on other sites More sharing options...
bogQ Posted September 7, 2008 Share Posted September 7, 2008 The initial form submission works, but it doesn't click on the next page. For clicking next page, I tried with this also: _IELinkClickByText($oIE, "Next", 1) But still doesn't work. Does anyone know why? Thanks!#include <IE.au3> ;~ #include <Debug.au3> ;~ _DebugSetup ("Google-click next") $oIE = _IECreate("http://www.google.com") ;~ _DebugOut ("Start....") $o_form = _IEFormGetObjByName($oIE, "f") $o_q = _IEFormElementGetObjByName($o_form, "q") $o_submit = _IEFormElementGetObjByName($o_form, "btnG") _IEFormElementSetValue($o_q, "test") _IEAction($o_submit, "click") ;~ _DebugOut("next page"); ;~ $sMyString = "Next" ;~ $oLinks = _IELinkGetCollection($oIE) ;~ For $oLink in $oLinks ;~ $sLinkText = _IEPropertyGet($oLink, "innertext") ;~ If StringInStr($sLinkText, $sMyString) Then ;~ _IEAction($oLink, "click") ;~ ExitLoop ;~ EndIf ;~ Next ;~ _DebugOut ("End....") ;~ The initial form submission works, but it doesn't click on the next page. For clicking next page, I tried with this also: _IELoadWait ($oIE) _IELinkClickByText($oIE, "Next") TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
autoit2008 Posted September 8, 2008 Author Share Posted September 8, 2008 Thanks! It works very well now. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now