Jump to content
Sign in to follow this  

Help With Internet Explorer Automation Udf Library

Recommended Posts



I need to make a script to extract from this site :


Some infos (temp,humd,..) every day at 8 o'clock.

I ´m using UDF library for Internet explorer. I think, i can use it to perform this action.

But it´s very dificult to find the ID´s or name of the html elements who hold the information.

i use this :

_IETableGetObjByIndex($oIE, 4)

But this code extract to me a long string with all the sub-strings inside the weather table. Maybe i can make a parser to have the information but i want to know if he exist an order way.

Thanks for your help.

Edited by danisam

Share this post

Link to post
Share on other sites

Take a look at this script that I made a while back. It should at least get you headed in the right direction. If I get a break from all the troubles we are having from lightning I'll see what I can put together.

Edit: Reread your post.

Edited by big_daddy

Share this post

Link to post
Share on other sites

Thanks for your response.

How can you know, than the informations are stok into the table number 2 ?

i need to know where to find my information.

$oTable2 = _IETableGetObjByIndex($oIE, 4)

$aWeather = _IETableWriteToArray($oTable2)

MsgBox(4096, "Test",$aWeather[0][0] ,100)

Whith this code i view all the content of the weather table at the cell [0][0] of the 2D array.

there is an other array into this cell ?


Edited by danisam

Share this post

Link to post
Share on other sites

First off with the code you provided you are actually reading the fifth table.


; This reads the first table
$oTable = _IETableGetObjByIndex($oIE, 0)
; This reads the second table
$oTable = _IETableGetObjByIndex($oIE, 1)

I haven't had much time, but this is what I've come up with so far.

#include <IE.au3>
#include <GUIConstants.au3>
#Include <GuiListView.au3>
#include <GuiStatusBar.au3>

$Form1 = GUICreate("Prónostico horario", 620, 440, 200, 125)
$List1 = GUICtrlCreateListView("Characteristics|Numbers", 8, 50, 600, 350)
$Button1 = GUICtrlCreateButton("GO", 240, 20, 33, 21, $BS_DEFPUSHBUTTON)
$StatusBar1 = _GuiCtrlStatusBarCreate ($Form1, 620, "", $SBT_TOOLTIPS)
_GuiCtrlStatusBarSetMinHeight ($StatusBar1, 35)
_GuiCtrlStatusBarSetText ($StatusBar1, ' Click the "GO" button.')
$Progress1 = GUICtrlCreateProgress(410, 412, 200, 20)
GUICtrlSetResizing($Progress1, $GUI_DOCKSTATEBAR)
GUICtrlSetState($Progress1, $GUI_HIDE)
While 1
    $msg = GUIGetMsg()
        Case $msg = $GUI_EVENT_CLOSE
        Case $msg = $Button1
            _GUICtrlListViewDeleteAllItems ($List1)
            _GuiCtrlStatusBarSetText ($StatusBar1, ' Gathering data, Please Wait....')
                GUICtrlSetData($Progress1, 0)
                GUICtrlSetState($Progress1, $GUI_SHOW)              
                If @error Then
                    MsgBox(0, "Connection Error!", "There was a problem connecting to the internet.")
                    _GuiCtrlStatusBarSetText ($StatusBar1, ' Check you internet connection and try again.')
                $oIE = _IECreate ()
                GUICtrlSetData($Progress1, 10)
                _IENavigate ($oIE, "http://espanol.weather.com/weather/hourbyhour/MXCL0013")
                GUICtrlSetData($Progress1, 20)
            ; Get a reference to the eighth table on the webpage (where the data is stored)
                $oTable = _IETableGetObjByIndex ($oIE, 7)
                GUICtrlSetData($Progress1, 70)
            ; Read the table cells into a 2-D array
                $aProfile = _IETableWriteToArray ($oTable)
                GUICtrlSetData($Progress1, 80)
                _IEQuit ($oIE)
                GUICtrlSetData($Progress1, 90)
            ; Write the array contents to the listview
                For $i = 0 To UBound($aProfile, 2) - 1
                    If $aProfile[0][$i] == 0 Then ContinueLoop
                    Local $lv_item = GUICtrlCreateListViewItem($aProfile[0][$i] & "|" & $aProfile[1][$i], $List1)
                GUICtrlSetData($Progress1, 100)
                _GUICtrlListViewSetColumnWidth ($List1, 0, $LVSCW_AUTOSIZE)
                _GUICtrlListViewSetColumnWidth ($List1, 1, $LVSCW_AUTOSIZE_USEHEADER)
                _GuiCtrlStatusBarSetText ($StatusBar1, ' Reading data complete.')
                GUICtrlSetState($Progress1, $GUI_HIDE)

Share this post

Link to post
Share on other sites

Thanks, i think i can do that now.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.