Patil Posted November 14, 2007 Share Posted November 14, 2007 #include <IE.au3> $oIE =_IECreate("http://www.yahoomail.com") ;opens the webpage $oForm = _IEFormGetCollection ($oIE, 0) Sleep (2000) $o_login = _IEGetObjByName($oIE,"login") _IEFormElementSetValue ($o_login, "username") $o_password = _IEGetObjByName($oIE,"passwd") _IEFormElementSetValue ($o_password,"password") $osignin = _IEFormElementGetObjByName ($oForm, "btn Sign In") _IEAction($osignin,"click") Hi, Here is the code to login into yahoo, after login how can i perform the search and sign out using the one script which can be used for login. I am getting confusion about the form at the first time i am assigning the all objets of the first Form that is login form after login it will open a different form their i am unable get the elements/objects in that form. Could you please help me and provide a code for this. Thanks, Santosh Link to comment Share on other sites More sharing options...
Patil Posted November 14, 2007 Author Share Posted November 14, 2007 #include <IE.au3> $oIE =_IECreate("http://www.yahoomail.com") ;opens the webpage $oForm = _IEFormGetCollection ($oIE, 0) Sleep (2000) $o_login = _IEGetObjByName($oIE,"login") _IEFormElementSetValue ($o_login, "username") $o_password = _IEGetObjByName($oIE,"passwd") _IEFormElementSetValue ($o_password,"password") $osignin = _IEFormElementGetObjByName ($oForm, "btn Sign In") _IEAction($osignin,"click") Hi, Here is the code to login into yahoo, after login how can i perform the search and sign out using the one script which can be used for login. I am getting confusion about the form at the first time i am assigning the all objets of the first Form that is login form after login it will open a different form their i am unable get the elements/objects in that form. Could you please help me and provide a code for this. Thanks, Santosh Hi, #include <IE.au3> $oIE =_IECreate("http://www.yahoomail.com") ;opens the webpage $oForm = _IEFormGetCollection ($oIE, 0) Sleep (2000) ; get pointers to the login form and username, password and signin fields ;$o_form = _IEFormGetObjByName($oIE,"f1") $o_login = _IEGetObjByName($oIE,"login") _IEFormElementSetValue ($o_login, "gulbarga_santosh") $o_password = _IEGetObjByName($oIE,"passwd") _IEFormElementSetValue ($o_password,"spatil") $o_signin=_IEGetObjByName($oIE,".save") $oIE =_IEAction($o_signin,"click") Sleep (2000) _IELinkClickByText($oIE,"Sign Out") this is the code i used for signout but i am getting this error [b]IE.au3 V2.3-1 Error from function _IELinkClickByText, $_IEStatus_InvalidDataType, tell me whats wrong in this? lz reply me...... Link to comment Share on other sites More sharing options...
DaleHohm Posted November 14, 2007 Share Posted November 14, 2007 InvalidDataType means that $oIE is not valid at the time you do the _IELinkClickByText -- most like still in the process of updating a page. Replace your Sleep command with _IELoadWait($oIE) and you should be fine. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
Patil Posted November 15, 2007 Author Share Posted November 15, 2007 InvalidDataType means that $oIE is not valid at the time you do the _IELinkClickByText -- most like still in the process of updating a page.Replace your Sleep command with _IELoadWait($oIE) and you should be fine.DaleHi thanks for your reply, but its not working. Still i am getting same error IE.au3 V2.3-1 Error from function _IELoadWait, $_IEStatus_InvalidDataTypeIE.au3 V2.3-1 Error from function _IELinkClickByText, $_IEStatus_InvalidDataTypeAnd if am use the same code to login for gmail its not working, even i have different code for my application if i use that for yahoo its not working and if i use the yahoo's login code it is not working for gmail. what wrong in this can any one tell what and where i am going wrong....thanks in advance......Santosh Link to comment Share on other sites More sharing options...
DaleHohm Posted November 15, 2007 Share Posted November 15, 2007 Doh! What you are doing is so silly I missed it. You are wiping out your $oIE object variable with this line: $oIE =_IEAction($o_signin,"click") change it to _IEAction($o_signin,"click") Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
Patil Posted November 15, 2007 Author Share Posted November 15, 2007 Doh!What you are doing is so silly I missed it.You are wiping out your $oIE object variable with this line:$oIE =_IEAction($o_signin,"click")change it to_IEAction($o_signin,"click")DaleGr8 and thanks a lot.................one more thing i want to that why don we use the same code for other site's login like gmail? Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 15, 2007 Share Posted November 15, 2007 Gr8 and thanks a lot.................one more thing i want to that why don we use the same code for other site's login like gmail?You can use similar code, but each login page is a little different. Are you working on a gmail login now? How far have you gotten? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Patil Posted November 15, 2007 Author Share Posted November 15, 2007 You can use similar code, but each login page is a little different. Are you working on a gmail login now? How far have you gotten? Hi, I have got all the stuffs for login, now i learnt some thing and i can code for all login application and its working....... one more thing i want to know that in autoit3 numbers can be used as string or not........ #include <Date.au3> #include <Array.au3> #include<string.au3> $sNewDate = StringSplit(_NowCalcDate(), "/") $y= $sNewDate[1] $m= $sNewDate[2] $d= $sNewDate[3] + 3 MsgBox ("","","" & _StringInsert ($d , "/" ,0)) i used this code to insert the slash symbol before the date i am unable to get what i am expecting........ Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 15, 2007 Share Posted November 15, 2007 Hi, I have got all the stuffs for login, now i learnt some thing and i can code for all login application and its working....... one more thing i want to know that in autoit3 numbers can be used as string or not........ i used this code to insert the slash symbol before the date i am unable to get what i am expecting........ Here's what is happening. What you get back from NowCalcDate() is a string. The array elements returned by StringSplit() are strings. When you perform the arithmetic operation for $d, AutoIt does a background conversion of the string to a number, then does the math, so $d is a number. When you try to do _StringInsert(), it is expecting a string input, not a number (no automatic conversion), so it returns the unmodified value. This makes it work: MsgBox("", "", _StringInsert(String($d), "/", 0)) AutoIt hides some of the variable typing issues from you, but you can't always ignore it. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Patil Posted November 15, 2007 Author Share Posted November 15, 2007 Here's what is happening. What you get back from NowCalcDate() is a string. The array elements returned by StringSplit() are strings. When you perform the arithmetic operation for $d, AutoIt does a background conversion of the string to a number, then does the math, so $d is a number. When you try to do _StringInsert(), it is expecting a string input, not a number (no automatic conversion), so it returns the unmodified value. This makes it work: MsgBox("", "", _StringInsert(String($d), "/", 0)) AutoIt hides some of the variable typing issues from you, but you can't always ignore it. wow i am really happy to get the reply even m getting the solution in ur reply thanks a lot...... It makes me lot of smile on face....... 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