Jump to content

_InetGetSource login?


Recommended Posts

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 :x

Link to comment
Share on other sites

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...