Jump to content
Sign in to follow this  
jbnv

Internet Explorer crashes while iterating through element collections

Recommended Posts

jbnv

I am using AutoIt and IE to scrape data from a small quantity of disparate websites. I have at least two different routines that are causing IE to crash and disrupt the extraction. I have identified that in both cases, IE crashes on the first "Next" statement that it encounters. Is this something that can be worked around? The project may be dead in the water if I can't find a way to get this data without IE crashing. 

One of the functions looks like this:

Func HTMLToExcel()
    Local $cAgentSpans = $oIE.document.querySelectorAll("span.menu")
    For $oAgentSpan In $cAgentSpans
        ...
        Local $cContractTables = $oAgentSpan.querySelectorAll("table")
        For $oContractTable In $cContractTables
            ...
        Next
    Next
EndFunc

And the other function looks like this:

Func HTMLToExcel()
    Local $tableCollection = $oIE.document.querySelectorAll("form > table")
    Local $tableIndex
    For $tableIndex = 3 to $tableCollection.length
        Local $table = $tableCollection.item($tableIndex)
        For $oTr In $table.querySelectorAll("tr")
            ...
        Next
    Next
EndFunc

 

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  

×