Jump to content

Get Ie Info Made Simple


Lapo
 Share

Recommended Posts

#include<IE.au3>

 $oIE = _IECreate()
 _IENavigate($oIE, "http://www.tin.it")
 getFormS()
    sleep(100)
    
$oForm= _IEFormGetObjByIndex($oIE, 1)
$oQuery = _IEFormElementGetObjByName($oForm, "USER")
$oQuery2 = _IEFormElementGetObjByName($oForm, "PASS")
_IEFormElementSetValue($oQuery, "Myusername")
_IEFormElementSetValue($oQuery2, "Mypassword")

Sleep(100)
 
;;;;;;;  $oIE.document.all.Act_Login.Click 
 
    sleep(1500)
func getForms()
    $oDoc = _IEDocumentGetObj($oIE)
    $forms = _IEFormGetCollection($oDoc)
    For $form in $forms
   ;    MsgBox(262144, "", "Form name: " & $form.name & @CRLF)
        _FWrite(@TempDir & "\Forms.tmp","Form name: " & $form.name & @CRLF)
        $fes = _IEFormElementGetCollection($form)
        For $fe in $fes
;MsgBox(262144, "",@Tab & $fe.name & @TAB & "Type: " & $fe.type & @CRLF)
 _FWrite(@TempDir & "\tmp.tmp",$form.name & @Tab & $fe.name & @TAB & "Type: " & $fe.type & @CRLF)
        Next
    Next
endFunc

 
Func _FWrite($temp1,$text)
$file = FileOpen($temp1, 1)
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
FileWrite($file, $text & @CRLF)
FileClose($file)
EndFunc
run("notepad "& @TempDir & "\tmp.tmp" )
run("notepad "& @TempDir & "\Forms.tmp" )

Link to comment
Share on other sites

By index :

#include <IE.au3>
$oIE = _IECreate()
$oIE.visible = 0
sleep(500)
_IENavigate($oIE, "http://www.libero.it/")
$oIE.visible = 1
sleep(100)
$oDoc = _IEDocumentGetObj($oIE)
;$oForm = _IEFormGetObjByName($oIE, "webmail")
$oForm= _IEFormGetObjByIndex($oIE, 8); Zero based index
Sleep(500)
$oQuery = _IEFormElementGetObjByName($oForm, "Username")
$oQuery2 = _IEFormElementGetObjByName($oForm, "Password")
$oButton = _IEFormElementGetObjByName($oForm, "Act_Login")
;$oButton = _IEFormElementGetObjByName($oForm, "Entra")
;sleep(1000)
$indx =_IEFormElementGetObjByIndex($oForm,1)
$indx2 =_IEFormElementGetObjByIndex($oForm,2); @libero
$indx3 =_IEFormElementGetObjByIndex($oForm,3)
$indx4 =_IEFormElementGetObjByIndex($oForm,4)

;MsgBox(262144, "", $indx)
_IEFormElementSetValue($indx, "myUSER")
_IEFormElementSetValue($indx3, "myPASS")
_IEFormElementSetValue($indx2, "libero")



Sleep(500)
;;;;;;;$oIE.document.all.Act_Login.Click 

$oDoc = _IEDocumentGetObj($oIE)
    
    $forms = _IEFormGetCollection($oDoc)
    For $form in $forms
   ;    MsgBox(262144, "", "Form name: " & $form.name & @CRLF)
        _FWrite(@TempDir & "\Forms.tmp","Form name: " & $form.name & @CRLF)
        $fes = _IEFormElementGetCollection($form)
        For $fe in $fes
;MsgBox(262144, "",@Tab & $fe.name & @TAB & "Type: " & $fe.type & @CRLF)
 _FWrite(@TempDir & "\Forms.tmp",$form.name & @Tab & $fe.name & @TAB & "Type: " & $fe.type & @CRLF)
        Next
    Next


Func _FWrite($temp1,$text)
$file = FileOpen($temp1, 1)
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
FileWrite($file, $text & @CRLF)
FileClose($file)
EndFunc

run("notepad "& @TempDir & "\Forms.tmp" )
Link to comment
Share on other sites

By index :

#include <IE.au3>
$oIE = _IECreate()
$oIE.visible = 0
sleep(500)
_IENavigate($oIE, "http://www.libero.it/")
$oIE.visible = 1
sleep(100)
$oDoc = _IEDocumentGetObj($oIE)
;$oForm = _IEFormGetObjByName($oIE, "webmail")
$oForm= _IEFormGetObjByIndex($oIE, 8); Zero based index
Sleep(500)
$oQuery = _IEFormElementGetObjByName($oForm, "Username")
$oQuery2 = _IEFormElementGetObjByName($oForm, "Password")
$oButton = _IEFormElementGetObjByName($oForm, "Act_Login")
;$oButton = _IEFormElementGetObjByName($oForm, "Entra")
;sleep(1000)
$indx =_IEFormElementGetObjByIndex($oForm,1)
$indx2 =_IEFormElementGetObjByIndex($oForm,2); @libero
$indx3 =_IEFormElementGetObjByIndex($oForm,3)
$indx4 =_IEFormElementGetObjByIndex($oForm,4)

;MsgBox(262144, "", $indx)
_IEFormElementSetValue($indx, "myUSER")
_IEFormElementSetValue($indx3, "myPASS")
_IEFormElementSetValue($indx2, "libero")
Sleep(500)
;;;;;;;$oIE.document.all.Act_Login.Click 

$oDoc = _IEDocumentGetObj($oIE)
    
    $forms = _IEFormGetCollection($oDoc)
    For $form in $forms
  ; MsgBox(262144, "", "Form name: " & $form.name & @CRLF)
        _FWrite(@TempDir & "\Forms.tmp","Form name: " & $form.name & @CRLF)
        $fes = _IEFormElementGetCollection($form)
        For $fe in $fes
;MsgBox(262144, "",@Tab & $fe.name & @TAB & "Type: " & $fe.type & @CRLF)
 _FWrite(@TempDir & "\Forms.tmp",$form.name & @Tab & $fe.name & @TAB & "Type: " & $fe.type & @CRLF)
        Next
    Next
Func _FWrite($temp1,$text)
$file = FileOpen($temp1, 1)
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
FileWrite($file, $text & @CRLF)
FileClose($file)
EndFunc

run("notepad "& @TempDir & "\Forms.tmp" )
Changed this

_IENavigate($oIE, "http://www.libero.it/")

to this

_IENavigate($oIE, "http://www.channel4.com/4money/ontv/deal_or_no_deal/freetoenter.html")

and I get the error shown here..

Posted Image

Thanks!

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

and I get the error shown here..

BY INDEX : (i have tried 0 and 1 )

#include <IE.au3>
$oIE = _IECreate()
$oIE.visible = 0
sleep(500)
_IENavigate($oIE, "http://www.channel4.com/4money/ontv/deal_or_no_deal/freetoenter.html")
$oIE.visible = 1
sleep(5000)
$oDoc = _IEDocumentGetObj($oIE)

;;;;;;;;;;;;;$oForm= _IEFormGetObjByIndex($oIE, 1); Zero based index
$oForm= _IEFormGetObjByIndex($oIE, 0); Zero based index

Sleep(500)
;;;;;;;$oIE.document.all.Act_Login.Click 

$oDoc = _IEDocumentGetObj($oIE)
    
    $forms = _IEFormGetCollection($oDoc)
    For $form in $forms
  ; MsgBox(262144, "", "Form name: " & $form.name & @CRLF)
        _FWrite(@TempDir & "\Forms.tmp","Form name: " & $form.name & @CRLF)
        $fes = _IEFormElementGetCollection($form)
        For $fe in $fes
;MsgBox(262144, "",@Tab & $fe.name & @TAB & "Type: " & $fe.type & @CRLF)
_FWrite(@TempDir & "\Type.tmp",$form.name & @Tab & $fe.name & @TAB & "Type: " & $fe.type & @CRLF)
        Next
    Next


Func _FWrite($temp1,$text)
$file = FileOpen($temp1, 1)
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
FileWrite($file, $text & @CRLF)
FileClose($file)
EndFunc

run("notepad "& @TempDir & "\Forms.tmp" )
run("notepad "& @TempDir & "\Type.tmp" )
Edited by Lapo
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...