muhmuuh Posted June 14, 2011 Share Posted June 14, 2011 (edited) Hello, fellow coders!I face a very strange problem that I couldn't resolve. The error I get isD:\links.au3 (118) : ==> The requested action with this object has failed.: If StringInStr($l.href, $struct[$j]) <> 0 Then If StringInStr($l.href^ ERRORI'm trying to browse all links on a site, check if they contain something and do something else Here is the code$ls = _IELinkGetCollection($ie) For $l In $ls For $j = 1 To $sn If StringInStr($l.href, $struct[$j]) <> 0 Then $fl = True ExitLoop 2 EndIf Next Nextbut one link 'breaks' my program. I can't find a way to solve this. isObj($l) returns true and isObj($l.href) throws the same error. Is there another way to check if $l.href is valid and skip it?The site I open is http://www.notaalmargen.net/ and the link that 'breaks' the program is 'karen'. When I move the mouse over it I don't see the link url in the bottom of the screen like a normal link. With debugbar I get href="http://karen092793@hotmail.com" I've noticed that on another similar site another link containing '@' crashes my program with the same error.Any ideas how to solve this problem?Thank you very much Edited June 15, 2011 by muhmuuh I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more. Link to comment Share on other sites More sharing options...
DaleHohm Posted June 15, 2011 Share Posted June 15, 2011 This doesn't make much sense. I've see similar unexplainable issues when the HTML on the page is invalid. I ran this page through validator.w3c.org and there are errors hear that part of the HTML, so that is my best guess. You can make the error non-fatal by adding _IEErrorHandlerRegister() to your code. 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...
muhmuuh Posted June 16, 2011 Author Share Posted June 16, 2011 Thank you for the help. I've searched the help file for some general error handler but I don't know why I didn't look in the IE UDF. About the error - I noticed that my program breaks on other sites on very similar links - 'href="http://something@hotmail.com" Probably those links were supposed to be mailto. But anyway, with _IEErrorHandlerRegister I just skip them. Thank you, Dale, one more time I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more. 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