Jump to content

IE link object problem


Recommended Posts

Hello, fellow coders!

I face a very strange problem that I couldn't resolve. The error I get is

D:\links.au3 (118) : ==> The requested action with this object has failed.:
If StringInStr($l.href, $struct[$j]) <> 0 Then
If StringInStr($l.href^ ERROR

I'm trying to browse all links on a site, check if they contain something and do something else :huh2:

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

Next

but 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 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

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

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 :huh2:

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...