3telnick Posted May 31, 2006 Share Posted May 31, 2006 I'm trying to do quite simple thing, that is to open page and click particular link on that page.When I show collection of all the links it seems to be ok, but when I try to click any link (by its index) I got error message:$links($_index).clickError: Illegal text at the end of atatement (one tatement per line).Invalid characters behind Object assignment!When I try to click link by its text script just do nothing...Below simple code source:#include <c:\Program Files\AutoIt3\Include\IE.au3>$oIE = _IECreate()_IENavigate($oIE, "http://www.somewhere.com/index.html")_IELoadWait($oIE)JustDoIt ("title","address","link to click")$oIE = _IEAttach ("somewhere","url")_IEAction ( $oIE, "quit")Func JustDoIt ($linka,$adres,$kliknij)_IEImgClick($oIE, $linka, "alt") $oIE = _IEAttach ($adres,"url") _IELinkClickByIndex ($oIE, 0) #cs $oLinks = _IELinkGetCollection ($oIE) For $oLink In $oLinks MsgBox(0, $oLink.id, $oLink.href) Next#ce _IEAction ( $oIE, "quit")EndFunc Link to comment Share on other sites More sharing options...
Balachander K Posted May 31, 2006 Share Posted May 31, 2006 _IEImgClick($oIE, $linka, "alt") $oIE = _IEAttach ($adres,"url") _IELinkClickByIndex ($oIE, 0) try to catch the error (@error) after you get the $oIE object.... Maybe u r not attaching properly... -Bala Link to comment Share on other sites More sharing options...
DaleHohm Posted May 31, 2006 Share Posted May 31, 2006 Is this really the exact message you get? $links($_index).click If so, something happened to your IE.au3 file... it should be: $links($i_index).click As Balachander K says, it is also a good idea to check your return values and @ERROR Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
3telnick Posted June 1, 2006 Author Share Posted June 1, 2006 Error message is $links($i_index).click (my fault).@ERROR returns 0 so it is ok (after all _IEAction ( $oIE, "quit") works perfectly).If I undo comment for part$oLinks = _IELinkGetCollection ($oIE)For $oLink In $oLinksMsgBox(0, $oLink.id, $oLink.href)Nextit returns all links on the page.Only _IELinkClickByIndex ($oIE, 0) doesn't work (I mean, fails with error mentioned before). Link to comment Share on other sites More sharing options...
DaleHohm Posted June 1, 2006 Share Posted June 1, 2006 (edited) Error message is $links($i_index).click (my fault).@ERROR returns 0 so it is ok (after all _IEAction ( $oIE, "quit") works perfectly).If I undo comment for part$oLinks = _IELinkGetCollection ($oIE)For $oLink In $oLinksMsgBox(0, $oLink.id, $oLink.href)Nextit returns all links on the page.Only _IELinkClickByIndex ($oIE, 0) doesn't work (I mean, fails with error mentioned before).Please download the latest version T2.0-2 and run in SciTe to get diagnostic messages as you run it.Also, please try to provide a reproducer that is accessible to me on the Internet.DaleUpdate: I can now reproduce. Stand by. Edited June 1, 2006 by DaleHohm Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
DaleHohm Posted June 1, 2006 Share Posted June 1, 2006 Please test with new version T2.0-3 and reporting any problems. thanks, Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
3telnick Posted June 2, 2006 Author Share Posted June 2, 2006 Works with latest IE.au3. Thanks a lot. 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