faustf Posted October 2, 2018 Posted October 2, 2018 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 expandcollapse popup#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
FrancescoDiMuro Posted October 2, 2018 Posted October 2, 2018 @faustf Why don't you put an @error checking when you create $oIE? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Developers Jos Posted October 2, 2018 Developers Posted October 2, 2018 1 minute ago, faustf said: good idea i try to do that thankz Seriously? caramen and FrancescoDiMuro 2 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
faustf Posted October 2, 2018 Author Posted October 2, 2018 find a problem $oIE = _IENavigate($oI sorry
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now