Sign in to follow this  
Followers 0
Valuater

Automate login to the Autoit forums

2 posts in this topic

#1 ·  Posted (edited)

i know that you can automatically "login" to these forums, however i would like to be able to do it within a script

such as

$web="http://www.autoitscript.com/forum/index.php?act=Login&amp&CODE=01&amp&CookieDate=1&UserName=MY NAME&PassWord=MY PASSWORD"

then run $web

I just need this one line, from there i would know what to do

thanks

8)

EDIT**********

even with IE.au3 would be great

my effort

#include <IE.au3>

    $user = "My Nane"
    $pass = " My Pass"
      
    $o_IE = _IECreate (); 0 = NOT VISIBLE

    _IENavigate ($o_IE, "http://www.autoitscript.com/forum/index.php?act=idx")
    $o_SearchForm = _IEFormGetObjByName ($o_IE, "form"); 0 form?
    
    $o_Keyword_1 = _IEFormElementGetObjByName ($o_SearchForm, "text")
    _IEFormElementSetValue ($o_Keyword_1, $user)
    
    
    $o_Keyword_2 = _IEFormElementGetObjByName ($o_SearchForm, "Password")
    _IEFormElementSetValue ($o_Keyword_2, $pass)
    
    Sleep(500)
    _IEFormSubmit ($o_SearchForm)
    
    _IEQuit($o_IE)

and the source

<td align="right" valign="middle"><form action="http://www.autoitscript.com/forum/index.php?amp;act=Login&amp;CODE=01&amp;CookieDate=1" method="post">
                <input type="text" size="20" name="UserName" onfocus="this.value=''" value="User Name" />
                <input type="password" size="20" name="PassWord" onfocus="this.value=''" value="ibfrules" />
                <input class="button" type="image" src="style_images/autoit/login-button.gif" />
            </form>     </td>

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites



i know that you can automatically "login" to these forums, however i would like to be able to do it within a script

such as

$web="http://www.autoitscript.com/forum/index.php?act=Login&amp&CODE=01&amp&CookieDate=1&UserName=MY NAME&PassWord=MY PASSWORD"

then run $web

I just need this one line, from there i would know what to do

thanks

8)

EDIT**********

even with IE.au3 would be great

my effort

#include <IE.au3>

    $user = "My Nane"
    $pass = " My Pass"
      
    $o_IE = _IECreate (); 0 = NOT VISIBLE

    _IENavigate ($o_IE, "http://www.autoitscript.com/forum/index.php?act=idx")
    $o_SearchForm = _IEFormGetObjByName ($o_IE, "form"); 0 form?
    
    $o_Keyword_1 = _IEFormElementGetObjByName ($o_SearchForm, "text")
    _IEFormElementSetValue ($o_Keyword_1, $user)
    
    
    $o_Keyword_2 = _IEFormElementGetObjByName ($o_SearchForm, "Password")
    _IEFormElementSetValue ($o_Keyword_2, $pass)
    
    Sleep(500)
    _IEFormSubmit ($o_SearchForm)
    
    _IEQuit($o_IE)

and the source

<td align="right" valign="middle"><form action="http://www.autoitscript.com/forum/index.php?amp;act=Login&amp;CODE=01&amp;CookieDate=1" method="post">
                <input type="text" size="20" name="UserName" onfocus="this.value=''" value="User Name" />
                <input type="password" size="20" name="PassWord" onfocus="this.value=''" value="ibfrules" />
                <input class="button" type="image" src="style_images/autoit/login-button.gif" />
            </form>     </td>

8)

I've looked at this a bit and I'm confused about what you are doing.

The name of the form on the forum login page is "LOGIN", the username field is "UserName" and the password field is "PassWord" and there is a Checkbox called "CookieDate".

I think that your "form", "text" and "Password" should be "LOGIN", "UserName" and "PassWord". Also, why the variable names of *keyword*? That's part of what makes me wonder if I really understand what you are trying to do...?

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0