Jump to content

Errors with _IETagNameGetCollection inside a loop


Recommended Posts

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?

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