Jump to content

form click button submit how to do


Recommended Posts

hi guy i try  to click a  button entra in this  site 

https://www.esprinet.com/public/index.asp

 

i use this script 

but  i dont know  why not  work  ,   someone can help me???  thankz

 

Func _entra_dentro()
    ConsoleWrite('@@ (1116) :(' & @MIN & ':' & @SEC & ') _entra_dentro()' & @CR) ;### Function Trace

    Global $oIE = _IECreate("https://www.esprinet.com/public/index.asp", 0, 1, 1, 1)
    Local $oForm = _IEGetObjById($oIE, "moduloLogin")
    Local $username = _IEFormElementGetObjByName($oForm, "utente")
    _IEFormElementSetValue($username, "xxxxxxxx")
    Local $pass = _IEFormElementGetObjByName($oForm, "pwd")
    _IEFormElementSetValue($pass, "xxxxxxx")
    Local $bottone = _IEFormGetObjByName($oForm, "bottone")
    _IEAction($bottone, "Focus")
    _IEAction($bottone, "Click")
    _IELoadWait($oIE)


    #cs
        Local $oBtns = _IELinkGetCollection($oIE)
        For $oBtn In $oBtns
        $classname = String($oBtn.classname())

        If $classname = "bottone" Then
        _IEAction($oBtn, "Focus")
        _IEAction($oBtn, "Click")
        _IELoadWait($oIE)
        EndIf

        Next


    #ce


    ;_IEFormSubmit($oForm, 0)
    ;_IELoadWait($oIE)
    _IEImgClick($oIE, "Entra nel sito", "alt")
    ;_IELoadWait($oIE)
    _IENavigate($oIE, "http://it.esprinet.com/Area_Operativa/DServizi_jolly_Speciale_BID.asp", 1)
    _IELoadWait($oIE)
    _IEImgClick($oIE, "btn-Fantaricerca.png", "src")
    ;_IELoadWait($oIE)
EndFunc   ;==>_entra_dentro

 

Link to comment
Share on other sites

@faustf DIV  FORM

_IEFormGetObjByName is to get the FORM not the "button" (bottone). An "bottone" is the element class not its name.

#include <IE.au3>

Global $oIE = _IECreate("https://www.esprinet.com/public/index.asp", 0, 1, 1, 1)

Local $oForm = _IEFormGetObjByName($oIE, "areaRis")
Local $username = _IEFormElementGetObjByName($oForm, "utente")
_IEFormElementSetValue($username, "xxxxxxxx")
Local $pass = _IEFormElementGetObjByName($oForm, "pwd")
_IEFormElementSetValue($pass, "xxxxxxx")
Local $bottone = _IEFormElementGetObjByName($oForm, "Submit")
_IEAction($bottone, "Click")

_IELoadWait($oIE)

 

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