Robobobatron

Help with IE library and getting the new page

2 posts in this topic

#1 ·  Posted

I am working with a page that does a database search and displays that data. i need to get the data from that page and store it. conceptually not a problem. however, i got to do it and when i navigate through the pages and get to the page were the data is at, the HTML auto it is attempting to manipulate is still the HTML from the first prompt to appear. any thoughts or ideas are appreciated

here is the current code

#include <Array.au3>
#include <Excel.au3>
#include <MsgBoxConstants.au3>
#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>
#include <IE.au3>

    $excelSource = FileOpenDialog("Please choose the ID source", @HomePath, "All (*.*)")
    $excelTarget = ""

    ConsoleWrite($excelSource&@CRLF)

    if (StringLen($excelSource) <> 0) then
        Local $oExcel = _Excel_Open()
        Local $oWorkbook = _Excel_BookOpen($oExcel, $excelSource, True, True)
        Local $aResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.Activesheet.Range("A1").CurrentRegion)
        _Excel_Close($oExcel, false, true)

        $IE = _IECreate("http://www.idoc.state.il.us/subsections/search/ISdefault2.asp")
        _IELoadWait($IE)
        if(UBound($aResult) <> 0) then
            for $cell in $aResult
                ConsoleWrite($cell&@CRLF)
                $form = _IEFormGetObjByName($IE, "form1")
                _IEFormElementRadioSelect($Form, "IDOC", "selectlist1" , 1, "byValue")
                $idocBox = _IEFormElementGetObjByName($Form, "idoc")
                _IEFormElementSetValue($idocBox, $cell)
            next
        Else
            ConsoleWrite($aResult&@CRLF)
            $form = _IEFormGetObjByName($IE, "form1")
            _IEFormElementRadioSelect($Form, "IDOC", "selectlist1" , 1, "byValue")
            $idocBox = _IEFormElementGetObjByName($Form, "idoc")
            _IEFormElementSetValue($idocBox, StringStripWS(String($aResult),8))
            $button = _IEFormElementGetCollection($form, 4)
            _IEAction($button, "click")
            _IELoadWait($IE)
            sleep(100)
            send("{TAB}")
            sleep(100)
            send("{TAB}")
            sleep(100)
            send("{TAB}")
            sleep(100)
            send("{TAB}")
            sleep(100)
            send("{TAB}")
            sleep(100)
            send("{TAB}")
            sleep(100)
            send("{ENTER}")
            sleep(500)
            $IE2 = _IEattach("Illinois Department of Corrections - Inmate Search")
            ConsoleWrite(_IEDocReadHTML($IE2))

the tabbing business is to try to work around the same problem as i must step though an initial prompt then a secondary one that suffers front he same problem of not being intractable for some reason. i can not however, work around not having access to data that is required.

Share this post


Link to post
Share on other sites



#2 ·  Posted

Not sure that I understand the issue. Can you demonstrate the problem without the Excel file? Are you having trouble reading the results of the initial query after searching for a name, ie: Smith, John?

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