Jump to content

Recommended Posts

Posted

hi guys , i have this script , but now  stop to work , and   give me always 

IE.au3 T3.0-2 Error from function _IEBodyReadHTML, $_IESTATUS_InvalidDataType

why ??? 

anyone can help me ? 

thankz

#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
#include <File.au3>
#include <IE.au3>
#include <Array.au3>
#include <INet.au3>

Global $iCont_truck = 0, $iGTimeToCeckTruck = 1000, $iGTimeOutTruck = 1000
; da disattivare quanto viene compilato sostituire cmdline array
Global $sGTipi = "Buste", $countryMittente = "Italia", $countryDestinatario = "Italia", $qtcolli = 3, $pesatemulti = "10|12|23|32|10|12|23|32|10|12|23|32"

_Truckpooling_it_WEB()

Func _Truckpooling_it_WEB()
    #cs
        If $CmdLine[0] = "" Or $CmdLine[0] = "?" Then
        _Help_truck()
        Else
    #ce
    Local $sleepButt = 5000
    Local $sleepPass = 100
    If ProcessExists("iexplore.exe") Then ; Check if the internet esplorer process is running.
        ProcessClose("iexplore.exe")
    EndIf
    ;#cs
    Select
        ;Case $CmdLine[3] = "Buste"
        Case $sGTipi = "Buste"
            Global $oIE = _IECreate("https://www.truckpooling.it/compare-prices?type=envelope", 0, 1, 1, 1) ; <--- 0011 invisible explorer  <--- 0111 visible explorer
            ;Case $CmdLine[3] = "Pacchi"
        Case $sGTipi = "Pacchi"
            Global $oIE = _IECreate("https://www.truckpooling.it/compare-prices?type=pack", 0, 1, 1, 1) ; <--- 0011 invisible explorer  <--- 0111 visible explorer
            ;Case $CmdLine[3] = "Pallets"
        Case $sGTipi = "Pallets"
            Global $oIE = _IECreate("https://www.truckpooling.it/compare-prices?type=pallet", 0, 1, 1, 1) ; <--- 0011 invisible explorer  <--- 0111 visible explorer
    EndSelect
    ;#ce
    ;Global $oIE = _IECreate("https://www.truckpooling.it/account/login", 0, 1, 1, 1) ; <--- 0011 invisible explorer  <--- 0111 visible explorer
    _IELoadWait($oIE, $iGTimeToCeckTruck, $iGTimeOutTruck)

    Local $sLBodyHtl = _IEBodyReadHTML($oIE)
    If StringInStr($sLBodyHtl, "Accedi") <> 0 Then
        _IENavigate($oIE, "https://www.truckpooling.it/account/login")
        _IELoadWait($oIE, $iGTimeToCeckTruck, $iGTimeOutTruck)
        Local $oLogin = _IEGetObjByName($oIE, "login")
        Do ; stay here untill the $oCUtilizzo object is ready (untill is an obj)
            Sleep(10)
        Until IsObj($oLogin)
        _IEAction($oLogin, "focus")
        _IEAction($oLogin, "Click")
        ;_IEFormElementSetValue($oLogin, $CmdLine[1]) ; user
        _IEFormElementSetValue($oLogin, "user") ; user

        Local $oPassword = _IEGetObjByName($oIE, "password")
        Do ; stay here untill the $oCUtilizzo object is ready (untill is an obj)
            Sleep(10)
        Until IsObj($oPassword)
        _IEAction($oPassword, "focus")
        _IEAction($oPassword, "Click")
        ;_IEFormElementSetValue($oLogin, $CmdLine[1]) ; user
        _IEFormElementSetValue($oPassword, "pass") ; user

        Local $oBtns = $oIE.document.GetElementsByTagName("button")
        For $oBtn In $oBtns
            $id = String($oBtn.classname())
            ;ConsoleWrite($classname & @CRLF)
            If $id = "btn btn-primary btn-tp-wide" Then
                _IEAction($oBtn, "click")
                ;   _IEFormElementSetValue($oBtn, $sUser)
            EndIf
        Next
    EndIf

    Select
        ;Case $CmdLine[3] = "Buste"
        Case $sGTipi = "Buste"
            $oIE = _IENavigate($oIE, "https://www.truckpooling.it/compare-prices?type=envelope") ; <--- 0011 invisible explorer  <--- 0111 visible explorer
            ;Case $CmdLine[3] = "Pacchi"
        Case $sGTipi = "Pacchi"
            $oIE = _IENavigate($oIE, "https://www.truckpooling.it/compare-prices?type=pack") ; <--- 0011 invisible explorer  <--- 0111 visible explorer
            ;Case $CmdLine[3] = "Pallets"
        Case $sGTipi = "Pallets"
            $oIE = _IENavigate($oIE, "https://www.truckpooling.it/compare-prices?type=pallet") ; <--- 0011 invisible explorer  <--- 0111 visible explorer
    EndSelect
    _IELoadWait($oIE, $iGTimeToCeckTruck, $iGTimeOutTruck)

    $sLBodyHtl = _IEBodyReadText($oIE)
    ConsoleWrite ($sLBodyHtl)


    $sLBodyHtl2 = _IEBodyReadHTML($oIE)
    ConsoleWrite ($sLBodyHtl2)


EndFunc

 

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
×
×
  • Create New...