shifty21 Posted November 28, 2007 Share Posted November 28, 2007 I'm trying to write a program that will auto sign me into eBay.ca Yes, I know that I can use the keep me signed in option! I'm just a newbie and I'm figuring out stuff. I read the example from the Auto 1-2-3 for signing into hotmail. Here's the code there: #include <IE.au3> ; Create a browser window and navigate to hotmail $oIE = _IECreate() _IENavigate($oIE, "http://www.hotmail.com") ; get pointers to the login form and username and password fields $o_form = _IEFormGetObjByName($oIE, "f1") $o_login = _IEFormElementGetObjByName($o_form, "login") $o_password = _IEFormElementGetObjByName($o_form, "passwd") ; Set field values and submit the form _IEFormElementSetValue($o_login, "your username here") _IEFormElementSetValue($o_password, "your password here") Sleep(2000) _IEFormSubmit($o_form) Exit What I don't understand is how to find the 'pointers' to the login form and username and password fields. Where do I find f1? From what I'm seeing, 'login' is what the text box on the page is called that is going to receive the email address (in this case). When I view the source of the webpage, I don't see how to find out that it's called 'login' Ya, I know it's a noob question to most. Thanks in advance. Link to comment Share on other sites More sharing options...
DaleHohm Posted November 28, 2007 Share Posted November 28, 2007 Download, install and use DebugBar (see my sig) and see how fast the mystery falls away. 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...
shifty21 Posted November 28, 2007 Author Share Posted November 28, 2007 Download, install and use DebugBar (see my sig) and see how fast the mystery falls away.DaleWell, you're right, that didn't take too long.Now for me to figure out how to write the code for eBay. Good times....I may be back again. Link to comment Share on other sites More sharing options...
shifty21 Posted November 28, 2007 Author Share Posted November 28, 2007 (edited) Here's the code that I came up with: #include <IE.au3> ; Script Start $oIE = _IECreate() _IENavigate($oIE, "https://signin.ebay.ca/ws/eBayISAPI.dll?SignIn&_trksid=m37") ; get pointers to the login form and username and password fields $o_form = _IEFormGetObjByName($oIE, "RegisterEnterInfo") $o_login = _IEFormElementGetObjByName($o_form, "userid") $o_password = _IEFormElementGetObjByName($o_form, "pass") ; Set field values and submit the form _IEFormElementSetValue($o_login, "my login") _IEFormElementSetValue($o_password, "my password") Sleep(2000) _IEFormSubmit($o_form) The eBay page comes up but I get this error in SciTE4AutoIt3: --> IE.au3 V2.3-1 Warning from function _IELoadWait, $_IEStatus_AccessIsDenied (Cannot verify readyState. Likely casue: cross-site scripting security restriction.) Does this just mean that eBay doesn't allow scripts to log into the site? Edited November 28, 2007 by shifty21 Link to comment Share on other sites More sharing options...
Generator Posted November 28, 2007 Share Posted November 28, 2007 Try to use _IEFormImageClick, unfortunately i don't have any eBay account to test with. 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