faustf Posted March 3, 2017 Posted March 3, 2017 hi guy how is possible login in this site ?? https://it.shpock.com/my/signup/ i try to use this code but not work expandcollapse popup#include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <File.au3> #include <IE.au3> #include <Array.au3> Global $ISP_WEB = 0 _StartShpock() Func _StartShpock() If ProcessExists("iexplore.exe") Then ; Check if the internet esplorer process is running. ProcessClose("iexplore.exe") EndIf Global $oIE = _IECreate("https://it.shpock.com/my/signup/", 0, 1, 1, 1) ; <--- 0011 invisible explorer <--- 0111 visible explorer _IELoadWait($oIE) Local $oFirstCheckBox = _IEGetObjByClass($oIE, "password") If IsObj($oFirstCheckBox) Then $oFirstCheckBox.checked = True EndIf EndFunc Func _IEGetObjByClass(ByRef $o_object, $s_Class, $i_index = 0) If Not IsObj($o_object) Then __IEConsoleWriteError("Error", "_IEGetObjByClass", "$_IEStatus_InvalidDataType") SetError($_IEStatus_InvalidDataType, 1) Return 0 EndIf ; If Not __IEIsObjType($o_object, "browserdom") Then __IEConsoleWriteError("Error", "_IEGetObjByClass", "$_IEStatus_InvalidObjectType") SetError($_IEStatus_InvalidObjectType, 1) Return 0 EndIf ; Local $i_found = 0 ; $o_tags = _IETagNameAllGetCollection($o_object) For $o_tag In $o_tags If String($o_tag.className) = $s_Class Then If ($i_found = $i_index) Then SetError($_IEStatus_Success) Return $o_tag Else $i_found += 1 EndIf EndIf Next ; __IEConsoleWriteError("Warning", "_IEGetObjByClass", "$_IEStatus_NoMatch", $s_Class) SetError($_IEStatus_NoMatch, 2) Return 0 EndFunc ;==>_IEGetObjByClass some one can help me ?? the html code <input type="text" placeholder="Indirizzo email"> <input type="password" placeholder="Password" class="password"> thankz at all
Danp2 Posted March 3, 2017 Posted March 3, 2017 26 minutes ago, faustf said: i try to use this code but not work "Doesn't work" isn't very descriptive. Post the output from the Scite window. Tell us which line it failed on. Give us something to go on... Also, why are you treating the password field as a checkbox? Latest Webdriver UDF Release Webdriver Wiki FAQs
faustf Posted March 3, 2017 Author Posted March 3, 2017 scite give me is all ok because i dont have idea how to write inside of it , because not have id or name or other marker how is possible to write inside of it ??? thankz
faustf Posted March 3, 2017 Author Posted March 3, 2017 (edited) thankz Bro for suppor i have find a solution Local $oBtns = $oIE.document.GetElementsByTagName("input") For $oBtn In $oBtns $classname = String($oBtn.classname()) $placehold = String($oBtn.placeholder()) ;ConsoleWrite($classname & @CRLF) If $classname = "password" Then _IEAction($oBtn, "click") _IEFormElementSetValue($oBtn, "lamail") EndIf If $placehold = "Indirizzo email" Then _IEAction ($oBtn, "click") _IEFormElementSetValue($oBtn, "passeraword") EndIf Next i put it for someone thankz again at all Edited March 3, 2017 by faustf
Danp2 Posted March 3, 2017 Posted March 3, 2017 This works as well ... #include <IE.au3> Local $oIE = _IECreate ("https://it.shpock.com/my/signup/") Local $oForm = _IEFormGetCollection($oIE, 0) Local $username = _IEFormElementGetCollection ($oForm, 1) Local $password = _IEFormElementGetCollection ($oForm, 2) _IEFormElementSetValue ($username, "myname") _IEFormElementSetValue ($password, "myPassword") _IEFormSubmit($oForm) faustf 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
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