Sign in to follow this  
Followers 0
joakim

Errors with _IETagNameGetCollection inside a loop

3 posts in this topic

I am trying to list the number of tags (in this particular case "ul") in a pagesource. It works fine if not used in a loop, so for instance this code works;

$oIE = _IEAttach("http://www.XXX/browse2?&CAR_MODEL/MAKE=3233","url")
$oInputs = _IETagNameGetCollection ($oIE, "ul")
MsgBox(0,"NUmber of tags","$oInputs: " & @extended)

But when moved inside a loop it only detects 1 tag, regardless of what type of tag I'm trying to identify. The list inside the variable $used_make is severely shortened here. But it is good enough for the reproduction of the error.

$used_make = "CAR_MODEL/MAKE=3233,CAR_MODEL/MAKE=6733"
$split = StringSplit($used_make, ",", 1)
For $i = 1 To $split[0]
    $url = "http://www.XXX/browse2?&" & $split[$i]
    $oIE = _IECreate($url)
    $oIE = _IELoadWait($oIE)
    $oInputs = _IETagNameGetCollection ($oIE, "ul")
    MsgBox(0,"NUmber of tags","$oInputs: " & @extended)
        _IEQuit($oIE)
Next

Any ideas?

Share this post


Link to post
Share on other sites



This line is screwing you:

$oIE =_IELoadWait($oIE)

Change it to :

_IELoadWait($oIE)

Share this post


Link to post
Share on other sites

Thank you, that worked perfect. :unsure:

Share this post


Link to post
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
Sign in to follow this  
Followers 0