pedmacedo Posted January 13, 2011 Share Posted January 13, 2011 Hey guys, I was trying to get the html of a page with _InetGetSource, but to acess this page I need first to login the site, so if I directly use _InetGetSouce I will receive the source of the login page, not the page I really need. The site does not allow auto logining or remembering password stuff :| Any tips? Thanks in advance Link to comment Share on other sites More sharing options...
JohnOne Posted January 13, 2011 Share Posted January 13, 2011 I think you're buggered if it dosent allow auto login. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
gerwim Posted January 13, 2011 Share Posted January 13, 2011 Only thing I can think of is creating a PHP script which will auto login (check CURL for PHP) and then echo the source (check file_get_contents for PHP) and then get the source from your php script with your autoit script. Yes, only way I can think of. Link to comment Share on other sites More sharing options...
pedmacedo Posted January 13, 2011 Author Share Posted January 13, 2011 Thanks guys, I solved the problem using the _IE UDF library. Link to comment Share on other sites More sharing options...
Newb Posted January 13, 2011 Share Posted January 13, 2011 Yep, for the sake of information for anyone who finds this post, this is a basic login script: #include <IE.au3> GLobal $website = _IECreate ("http://www.autoitscript.com/forum/index.php") Global $User="name",$Pass="passwordz" _Login($website,$User,$Pass) Func _Login($oIE,$Username,$Password) _IELoadWait($oIE) Local $oLogForm = _IEFormGetCollection ($oIE,0) Local $oFormUser=_IEFormElementGetCollection ($oLogForm,0) Local $oFormPass=_IEFormElementGetCollection ($oLogForm,1) _IEFormElementSetValue($oFormUser,$Username) _IEFormElementSetValue($oFormPass,$Password) _IEFormSubmit($oLogForm) _IELoadWait($oIE) EndFunc Obviously, take a look at GetCollection parameters, because this won't work if you don't address them to the right form and form element. Check Help file for infos on those. Don't know if this work on autoit forum, I put the first form that exists in the page, but i think you got how it works. I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it. 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