newscripter Posted February 8, 2016 Posted February 8, 2016 (edited) Hi all, I am trying to find an object using a function which i also use earlier in the script. This time however, it does not work. Can anyone help me? The last command does not work. #RequireAdmin #include <IE.au3> #include <Array.au3> global $url="https://bestellen.dominos.nl/eStore/nl/CustomerDetails/Delivery" Local $browser = _IECreate($url) _IELoadWait($browser) local $txt=_IEGetObjByID($browser,"customer-postcode") _IEFormElementSetValue($txt,"9712gr") local $txt2=_IEGetObjByID($browser,"customer-street-no") _IEFormElementSetValue($txt2,"1") _IEFormSubmit($browser,$txt2) global $button=_IEGetObjById($browser,"order-time-button") _IEAction($button, "click") _Ieloadwait($browser) global $button2=_IEGetObjById($browser,"store-result btn next") _IEAction($button, "click") Edited February 8, 2016 by newscripter
Danyfirex Posted February 8, 2016 Posted February 8, 2016 You can't because that button has not id just classname. I made a simple funtion for get the object by classname. #RequireAdmin #include <IE.au3> #include <Array.au3> Global $url = "https://bestellen.dominos.nl/eStore/nl/CustomerDetails/Delivery" Local $browser = _IECreate($url) _IELoadWait($browser) Local $txt = _IEGetObjById($browser, "customer-postcode") _IEFormElementSetValue($txt, "9712gr") Local $txt2 = _IEGetObjById($browser, "customer-street-no") _IEFormElementSetValue($txt2, "1") _IEFormSubmit($browser, $txt2) Global $button = _IEGetObjById($browser, "order-time-button") _IEAction($button, "click") _IELoadWait($browser) Local $oBtnNextRetult=_GetObjByClass($browser, 'store-result btn next') _IEAction($oBtnNextRetult, "click") _IELoadWait($browser) Func _GetObjByClass($oIE, $sClassName) Local $oaTags = _IETagNameGetCollection($oIE, "a") Local $oResutlt = 0 For $oaTag In $oaTags If $oaTag.classname = $sClassName Then $oResutlt = $oaTag ExitLoop EndIf Next Return $oResutlt EndFunc ;==>_GetObjByClass Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
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