arryo Posted October 27, 2009 Share Posted October 27, 2009 Hello, I have here my YouTube Script which should work succesfull: expandcollapse popup#include <IE.au3> $acc = "MyAcc" ; change it perhaps if you want to try it. $pw = "Iwonttell" ; change it perhaps if you want to try it. $login = "Unknown" $checklogin1 = _IECreate("www.youtube.com") $check =_IEPropertyGet ($checklogin1, "locationname") _IENavigate ($checklogin1, "http://www.youtube.com/login") $oForm = _IEFormGetObjByName($checklogin1, "gaia_loginform") $oUsername = _IEFormElementGetObjByName($oForm, "Email") _IEFormElementSetValue($oUsername, $acc) $oPasswd = _IEFormElementGetObjByName($oForm, "Passwd") ToolTip("1",0,0) _IEFormElementSetValue($oPasswd, $pw) Sleep(2000) ; perhaps useless? ToolTip("2",0,0) _IEFormSubmit($oForm) ; HERE IT PAUSES FOR SOME REASONS THE SCRIPT! ToolTip("2.5",0,0) Sleep(5000) ; perhaps useless? ToolTip("3",0,0) ToolTip("4",0,0) If _IEPropertyGet($checklogin1, "locationname") = "YouTube - "&$acc&"'s YouTube - Windows Internet Explorer" Then ToolTip("5",0,0) $login = "Success!" Else ToolTip("6",0,0) $login = "Failed!" EndIf Msgbox(1, "lol", $login) Sleep(1000) ; useless. just for tests. ToolTip("7",0,0) _IEQuit ($checklogin1) MsgBox(1, "lol", "Finished!") The problem is definitely _IEFormSubmit($oForm). Any Solutions? (This Script only works if you are not logged in in Youtube). Link to comment Share on other sites More sharing options...
ame1011 Posted October 28, 2009 Share Posted October 28, 2009 #include <IE.au3> Local $oUser, $oPass, $oSubmit Local $sUser = "testUsername" Local $sPass = "testPassword" Local $url = "http://www.youtube.com/login" Local $oIE = _IECreate($url, 1) _IELoadWait($oIE) $oInputs = _IETagNameGetCollection($oIE, "input") for $oInput in $oInputs if $oInput.type = "text" And $oInput.name = "Email" And $oInput.id = "Email" And $oInput.size = "18" Then $oUser = $oInput if $oInput.type = "password" And $oInput.name = "Passwd" And $oInput.id = "Passwd" And $oInput.size = "18" Then $oPass = $oInput if $oInput.type = "submit" And $oInput.name = "signIn" And $oInput.value = "Sign in" Then $oSubmit = $oInput if IsObj($oUser) and IsObj($oPass) and IsObj($oSubmit) then ExitLoop Next $oUser.value = $sUser $oPass.value = $sPass _IEAction($oSubmit, "click") _IELoadWait($oIE) [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
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