none
Auto Login to Website

    Question

  • Im trying to generate a script that will check service using a webtool built in our website.
    What the script does is will run every xx amount of times and shoot out a txt output to be emailed to sys admins.
    The piece I am missing is trying to figure out an auto login feature that will login with admin user id and password and proceed with the script that I've written.
    Unfortunately saving userid and password via forms in Internet Explorer wont work as it requires you to click "OK" to respond to the logon page.
    I'm looking for something "unattended."
    Please advise.
    Thanks!

    Tuesday, June 29, 2010 6:14 PM

Answers

  • If the OK button has an ID or Name it can be 'clicked' using DHTML by your script.  Even if it's name is not known, it is still possible to access all of the <input> tags and find the ones that are of type "button" with a value of "OK".  Once that is done, just 'click' that control.  For example ...

    DIM IE
    DIM ipf

    Set IE = CreateObject("InternetExplorer.Application")
    IE.navigate "http://zip4.usps.com/zip4/citytown.jsp"
    IE.Visible = True

    While IE.Busy
         WScript.Sleep 50
    Wend

    Set ipf = IE.document.all.getElementByID("city")
    ipf.Value = "redmond" 'fill in the text box
    Set ipf = IE.document.all.state
    ipf.Value = "WA" 'fill in the text box
    Set ipf = IE.document.all.Submit
    ipf.Click    'click the submit button
    'IE.Quit


    Tom Lavedas
    Tuesday, June 29, 2010 6:29 PM
    Moderator
  • Yes, what I posted is in VBScript.  Yes, it could be saved as a VBS file and executed from the command console as part of a batch procedure, but you do realize that what I posted is merely an example.  A script to do your tasks needs to be tailored to match your exact conditions.  To remain synchronized with the batch procedure, the VBS script would need to be launched with the START utility with its /Wait switch, as in ...

      start "" /wait wscript somepath\yourscript.vbs

    However, I'm very surprised that you are contemplating trying to use a web based utility from within a batch procedure.  How do you expect to retrieve the information from the batch procedure - or does it just need to be started, and it (the web utility) does all of the rest?  IMHO, batch is just not up to the task.


    Tom Lavedas
    Tuesday, June 29, 2010 7:51 PM
    Moderator
  • The script I posted is a sufficient model of how to do both the "start website url /wait and the "autologin" part of your problem, though it must reference your URL and then reference the IDs of the controls instantiated on that page and supply the appropriate inputs.  So, for that part it is very doable.

    However, the part about "go through the procedures" is another story.  It certainly seems to me to be beyond the scope of a batch procedure.  And, while a VBS or powershell script can do it, it requires detailed knowledge of your specific web application.  In VBS, I would expect the approach to exercising the procedures to be similar to those I illustrated earlier.  That is, identify the names/IDs or some other measurable attribute or property of the desired controls and then fill in/click them as needed in the proper order to exercise each in turn.  However, in practice, it's never quite as easy as that.  For one thing, additional code is needed to pause the script long enough to let windows reload (and confirm that it happened as expected) as different pages are accessed.  It's not too hard to do, generally, but requires very specific knowledge of the page(s) being exercised.

    So, the bottom line is that its quite doable, but not particularly easy - in script (other than batch - except as the starting agent, maybe).  If you propose to try it, craft as much of the solution as you can and then ask a SPECIFIC question about each step that causes you a problem, giving details about the particular control or aspect of the process you are trying to automate or that are giving you trouble (include all error messages/symptoms of failure).  Don't imply that you're soliciting a response to complete the whole job or almost no one is likely to respond.  I certainly don't have the time or desire to take on this task (for free and I'm not soliciting work, either).

    HTH,


    Tom Lavedas
    Tuesday, June 29, 2010 9:21 PM
    Moderator

All replies

  • If the OK button has an ID or Name it can be 'clicked' using DHTML by your script.  Even if it's name is not known, it is still possible to access all of the <input> tags and find the ones that are of type "button" with a value of "OK".  Once that is done, just 'click' that control.  For example ...

    DIM IE
    DIM ipf

    Set IE = CreateObject("InternetExplorer.Application")
    IE.navigate "http://zip4.usps.com/zip4/citytown.jsp"
    IE.Visible = True

    While IE.Busy
         WScript.Sleep 50
    Wend

    Set ipf = IE.document.all.getElementByID("city")
    ipf.Value = "redmond" 'fill in the text box
    Set ipf = IE.document.all.state
    ipf.Value = "WA" 'fill in the text box
    Set ipf = IE.document.all.Submit
    ipf.Click    'click the submit button
    'IE.Quit


    Tom Lavedas
    Tuesday, June 29, 2010 6:29 PM
    Moderator
  • Thanks for your response!

    So with the code you've posted, it looks like a vbs script is that right?

    My script is written in .bat file.

    If so can I copy/paste this script into a notepad and save it as .vbs then input in my .bat script to call this .vbs so it can login per .vbs script rule?

     

     

    Tuesday, June 29, 2010 7:29 PM
  • Yes, what I posted is in VBScript.  Yes, it could be saved as a VBS file and executed from the command console as part of a batch procedure, but you do realize that what I posted is merely an example.  A script to do your tasks needs to be tailored to match your exact conditions.  To remain synchronized with the batch procedure, the VBS script would need to be launched with the START utility with its /Wait switch, as in ...

      start "" /wait wscript somepath\yourscript.vbs

    However, I'm very surprised that you are contemplating trying to use a web based utility from within a batch procedure.  How do you expect to retrieve the information from the batch procedure - or does it just need to be started, and it (the web utility) does all of the rest?  IMHO, batch is just not up to the task.


    Tom Lavedas
    Tuesday, June 29, 2010 7:51 PM
    Moderator
  • Ok, that make sense.

    Yes basically the script will just login and the rest will have conditions and generate the report.

    What I'm just looking for is a script that will login automatically then proceed with the conditions that I have on next phase.

    start script > start website url /wait wscript > call autologing.vbs > then go through the procedures once logged in.

    Does that sound possible?

    Tuesday, June 29, 2010 8:53 PM
  • The script I posted is a sufficient model of how to do both the "start website url /wait and the "autologin" part of your problem, though it must reference your URL and then reference the IDs of the controls instantiated on that page and supply the appropriate inputs.  So, for that part it is very doable.

    However, the part about "go through the procedures" is another story.  It certainly seems to me to be beyond the scope of a batch procedure.  And, while a VBS or powershell script can do it, it requires detailed knowledge of your specific web application.  In VBS, I would expect the approach to exercising the procedures to be similar to those I illustrated earlier.  That is, identify the names/IDs or some other measurable attribute or property of the desired controls and then fill in/click them as needed in the proper order to exercise each in turn.  However, in practice, it's never quite as easy as that.  For one thing, additional code is needed to pause the script long enough to let windows reload (and confirm that it happened as expected) as different pages are accessed.  It's not too hard to do, generally, but requires very specific knowledge of the page(s) being exercised.

    So, the bottom line is that its quite doable, but not particularly easy - in script (other than batch - except as the starting agent, maybe).  If you propose to try it, craft as much of the solution as you can and then ask a SPECIFIC question about each step that causes you a problem, giving details about the particular control or aspect of the process you are trying to automate or that are giving you trouble (include all error messages/symptoms of failure).  Don't imply that you're soliciting a response to complete the whole job or almost no one is likely to respond.  I certainly don't have the time or desire to take on this task (for free and I'm not soliciting work, either).

    HTH,


    Tom Lavedas
    Tuesday, June 29, 2010 9:21 PM
    Moderator
  • Hi,

     

    Can you please help/guide on the following?

    "I need a script that will:

    1) open a https://xyz.com/login page

    2) provide user name and password information

    3) check whether the authentication was successful or not or the web page is opening up

    4) store the results got in step 3) in a log file

     

    By this way, we will be able to determine on a periodic basis that a particular link is working or not."

    Wednesday, November 03, 2010 11:42 AM
  • Per the template I posted ...

    '1)

    DIM oIE

    Set oIE = CreateObject("InternetExplorer.Application")
    oIE.navigate "https://xyz.com/login"
    oIE.Visible = True

    n = 0
    Do while oIE.Busy or n = 101
      n = n + 1
      WSH.Sleep 50
    Loop
    if n = 101 then wsh.echo "ERROR" : wsh.quit 1

    '2)

    Set UID = oIE.document.all.IDToken1
    UID.value = "theUserID"

    Set PWD = oIE.document.all.IDToken2
    PWD.value = "thePassword"

    oIE.document.all.btnSubmit.click

    '3)
    sLocation = "*ERROR*"
    n = 0
    Do until oIE.document.ReadyState = "complete" or n=100
      n=n+1
      WSH.Sleep 50
    Loop

    sLocation = lcase(unescape(oIE.document.location))

    set oLogfile = CreateObject("scripting.filesystemobject").opentextfile("d:\someplace\logfile.txt", 8, true)
    if not sLocation = "https://xyz.com/the/expected/destination_page.ext" then
      oLogfile.writeline "Login failed"
    else

    '4)
       oLogfile.writeline "You made it to " & sLocation

    end if

    You need to provide the correct designations for the elements IDToken1 (the user ID control), IDToken2 (password control) and the submit button (btnSubmit).  I am certain they will be different than those I used in my example.  Open the source for the target login page and search for the correct controls.

    BTW, it is unusual for login pages to be secure URLs (the S on https:// in your example).  I'd check that part to see if its right.


    Tom Lavedas
    Wednesday, November 03, 2010 5:40 PM
    Moderator
  • Thank you so much Tom..

     

    I'm glad that you replied. I'll get back to you with the testings soon.

     

    Was not able to check the blog as we had festive season in India (Diwali, Bhaiyadooj etc.)

     

    Once again Thank you.

    Monday, November 08, 2010 12:37 PM
  • Hi Tom,

     

    That's wornderful. The code has worked like charm. I was able to login successfully into a website after providing correct value for the IDToken1, IDToken2, and btnSubmit button.

     

    However, on another site i was not able to get the name of submit button. I've attached the login page code below. Can you please look over what is the matter?

     

    <<<<<<<<<<<<<<<<code starts here>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
        <head>
            <meta http-equiv="content-type" content="text/html; charset=UTF-8">
            <meta http-equiv="X-UA-Compatible" content="IE=8">
            <meta http-equiv="X-UA-Compatible" content="chrome=1">
            
            
            
            <title>Login&nbsp;- BigFix Web Reports</title>
            <?import /JavaScript/yui/build/reset-fonts-grids/reset-fonts-grids.css?>
            
            <?import /JavaScript/yui/build/yahoo/yahoo.js?>
            <?import /JavaScript/yui/build/dom/dom.js?>
            <?import /JavaScript/yui/build/event/event.js?>
            <?import /JavaScript/yui/build/history/history.js?>
            
            <?import /JavaScript/Util/DOM.js?>
            <?import /JavaScript/Util/Run.js?>
            
            <link rel="stylesheet" type="text/css" href="/JavaScript/yui/build/reset-fonts-grids/reset-fonts-grids.css?modified=3368681424">
    <script type="text/javascript" src="/JavaScript/yui/build/yahoo/yahoo-min.js?modified=3368681424"></script>
    <script type="text/javascript" src="/JavaScript/yui/build/dom/dom-min.js?modified=3368681422"></script>
    <script type="text/javascript" src="/JavaScript/yui/build/event/event-min.js?modified=3368681424"></script>
    <script type="text/javascript" src="/JavaScript/yui/build/history/history-min.js?modified=3368681424"></script>
    <script type="text/javascript" src="/JavaScript/WR-min.js?modified=3368684678"></script>
    <script type="text/javascript" src="/JavaScript/yui/build/yahoo-dom-event/yahoo-dom-event.js?modified=3368681424"></script>
    <script type="text/javascript" src="/JavaScript/yui-import/Dom-min.js?modified=3368684778"></script>
    <script type="text/javascript" src="/JavaScript/yui-import/Event-min.js?modified=3368684780"></script>
    <script type="text/javascript" src="/JavaScript/Util/DOM-min.js?modified=3368684760"></script>
    <script type="text/javascript" src="/JavaScript/Util/HTML-min.js?modified=3368684764"></script>
    <script type="text/javascript" src="/JavaScript/Notification/Notification-min.js?modified=3368684754"></script>
    <script type="text/javascript" src="/JavaScript/json2-min.js?modified=3368684672"></script>
    <script type="text/javascript" src="/JavaScript/Util/Run-min.js?modified=3368684768"></script>
     
            
            <link rel="stylesheet" type="text/css" href="/css/besreports/ENU/chrome.css">
            <link rel="stylesheet" type="text/css" href="/css/besreports/ENU/login.css">
        </head>
        <body class=" yui-skin-sam" >       
            <div id="wr_header">
                <div id="wr_headertop">
     
                    <div id="wr_pagetitle">
                        <div id="wr_logo">
                            <img class="wr_logoimg" src="/images/besreports/ENU/logo_68.png" />
                        </div>
                        <div id="wr_title">
                            <img class="wr_logotitle" src="/images/besreports/ENU/header_title.png" alt="Web Reports" />
                        </div>
     
                    </div>
                    
                    <div id="wr_rightheader">
                        <ul class="wr_horizontal">
                        </ul>
                    </div>
                </div>
                <div id="wr_headerbottom">
                    <div id="wr_leftheaderbottom">
                        <div id="wr_headertitle"></div>
                                            <div id="wr_versionHeader">
                                                version 8.0.627.0
                                            </div>                    
     
                       </div>
                    <div id="wr_rightheaderbottom">
                    </div>
                </div>
                <div class="wr_dummy">
                </div>
            </div>        
            
            <div id="wr_mainpage">
                <div id="wr_logincontent">
                    <p></p>
                    <div id="wr_loginbox">
                        <h2>Login</h2>
                        <div id="wr_logindesc">Please enter your username and password to connect to Web Reports.</div>
                        <form method="POST" action="/webreports" name="LoginForm" id="LoginForm">
                            <input type=hidden name="page" value="LoggingIn"><input type=hidden name="fwdpage" value="">
                            <table>
                                <tr>
                                    <td class="label">Username:</td>
                                    <td class="text"><input type="text" class="text" name="Username" size="20" value="" id="Username"></td>
                                </tr>
                                <tr>
                                    <td class="label">Password:</td>
                                    <td class="text"><input type="password" class="text" name="Password" size="20" value="" id="Password"></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td class="submit"><input type=submit class="WR-button" value=" Login "></td>
                                </tr>
                            </table>
                            
                        </form>
                    </div>
                </div>
            </div>
            
            <script> WR.run( function() {
            
            function FragmentText()
            {
                var href = top.location.href;
                var i = href.indexOf( "#" );
                return i >= 0 ? href.substr( i + 1 ) : null;
            }
            
            YAHOO.util.Event.onDOMReady( function() {
                YAHOO.util.Dom.get( "Username" ).focus();
                
                var fragment = FragmentText();
                
                if ( fragment )
                    new WR.DOM.Element( YAHOO.util.Dom.get( "LoginForm" ) )
                        .appendChild( new WR.DOM.Element( "input" )
                            .setProperty( "type", "hidden" )
                            .setProperty( "name", "Fragment" )
                            .setProperty( "value", fragment )
                            .finish()
                        );
            });
            
            } ); </script>
            
        </body>
    </html>

    Hi Tom,

    That's wonderful. The script is working like charm. I provided the correct value for IDToken1, IDToken2, and btnSubmit and was able to login into a webpage.

    But on another site i was looking, it doesn't have any name=<name of submit button> in the source code. I've attached the login page code here. Please look and suggest what is wrong with it or how we can deal with these types of pages?

    <<<<<<<<<<<<<<<<code starts here>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

     

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
        <head>
            <meta http-equiv="content-type" content="text/html; charset=UTF-8">
            <meta http-equiv="X-UA-Compatible" content="IE=8">
            <meta http-equiv="X-UA-Compatible" content="chrome=1">
           
           
           
            <title>Login&nbsp;- BigFix Web Reports</title>
            <?import /JavaScript/yui/build/reset-fonts-grids/reset-fonts-grids.css?>
           
            <?import /JavaScript/yui/build/yahoo/yahoo.js?>
            <?import /JavaScript/yui/build/dom/dom.js?>
            <?import /JavaScript/yui/build/event/event.js?>
            <?import /JavaScript/yui/build/history/history.js?>
           
            <?import /JavaScript/Util/DOM.js?>
            <?import /JavaScript/Util/Run.js?>
           
            <link rel="stylesheet" type="text/css" href="/JavaScript/yui/build/reset-fonts-grids/reset-fonts-grids.css?modified=3368681424">
    <script type="text/javascript" src="/JavaScript/yui/build/yahoo/yahoo-min.js?modified=3368681424"></script>
    <script type="text/javascript" src="/JavaScript/yui/build/dom/dom-min.js?modified=3368681422"></script>
    <script type="text/javascript" src="/JavaScript/yui/build/event/event-min.js?modified=3368681424"></script>
    <script type="text/javascript" src="/JavaScript/yui/build/history/history-min.js?modified=3368681424"></script>
    <script type="text/javascript" src="/JavaScript/WR-min.js?modified=3368684678"></script>
    <script type="text/javascript" src="/JavaScript/yui/build/yahoo-dom-event/yahoo-dom-event.js?modified=3368681424"></script>
    <script type="text/javascript" src="/JavaScript/yui-import/Dom-min.js?modified=3368684778"></script>
    <script type="text/javascript" src="/JavaScript/yui-import/Event-min.js?modified=3368684780"></script>
    <script type="text/javascript" src="/JavaScript/Util/DOM-min.js?modified=3368684760"></script>
    <script type="text/javascript" src="/JavaScript/Util/HTML-min.js?modified=3368684764"></script>
    <script type="text/javascript" src="/JavaScript/Notification/Notification-min.js?modified=3368684754"></script>
    <script type="text/javascript" src="/JavaScript/json2-min.js?modified=3368684672"></script>
    <script type="text/javascript" src="/JavaScript/Util/Run-min.js?modified=3368684768"></script>
     
           
            <link rel="stylesheet" type="text/css" href="/css/besreports/ENU/chrome.css">
            <link rel="stylesheet" type="text/css" href="/css/besreports/ENU/login.css">
        </head>
        <body class=" yui-skin-sam" >      
            <div id="wr_header">
                <div id="wr_headertop">
     
                    <div id="wr_pagetitle">
                        <div id="wr_logo">
                            <img class="wr_logoimg" src="/images/besreports/ENU/logo_68.png" />
                        </div>
                        <div id="wr_title">
                            <img class="wr_logotitle" src="/images/besreports/ENU/header_title.png" alt="Web Reports" />
                        </div>
     
                    </div>
                   
                    <div id="wr_rightheader">
                        <ul class="wr_horizontal">
                        </ul>
                    </div>
                </div>
                <div id="wr_headerbottom">
                    <div id="wr_leftheaderbottom">
                        <div id="wr_headertitle"></div>
                                            <div id="wr_versionHeader">
                                                version 8.0.627.0
                                            </div>                   
     
                       </div>
                    <div id="wr_rightheaderbottom">
                    </div>
                </div>
                <div class="wr_dummy">
                </div>
            </div>       
           
            <div id="wr_mainpage">
                <div id="wr_logincontent">
                    <p></p>
                    <div id="wr_loginbox">
                        <h2>Login</h2>
                        <div id="wr_logindesc">Please enter your username and password to connect to Web Reports.</div>
                        <form method="POST" action="/webreports" name="LoginForm" id="LoginForm">
                            <input type=hidden name="page" value="LoggingIn"><input type=hidden name="fwdpage" value="">
                            <table>
                                <tr>
                                    <td class="label">Username:</td>
                                    <td class="text"><input type="text" class="text" name="Username" size="20" value="" id="Username"></td>
                                </tr>
                                <tr>
                                    <td class="label">Password:</td>
                                    <td class="text"><input type="password" class="text" name="Password" size="20" value="" id="Password"></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td class="submit"><input type=submit class="WR-button" value=" Login "></td>
                                </tr>
                            </table>
                           
                        </form>
                    </div>
                </div>
            </div>
           
            <script> WR.run( function() {
           
            function FragmentText()
            {
                var href = top.location.href;
                var i = href.indexOf( "#" );
                return i >= 0 ? href.substr( i + 1 ) : null;
            }
           
            YAHOO.util.Event.onDOMReady( function() {
                YAHOO.util.Dom.get( "Username" ).focus();
               
                var fragment = FragmentText();
               
                if ( fragment )
                    new WR.DOM.Element( YAHOO.util.Dom.get( "LoginForm" ) )
                        .appendChild( new WR.DOM.Element( "input" )
                            .setProperty( "type", "hidden" )
                            .setProperty( "name", "Fragment" )
                            .setProperty( "value", fragment )
                            .finish()
                        );
            });
           
            } ); </script>
           
        </body>
    </html>

    <<<<<<<<<<<<<<<<code ends here>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

     

    Monday, November 08, 2010 1:50 PM
  • This is one of those more difficult cases where the tag needs to be located by some other characteristic than its ID or Name, because the element has neither an ID or a name.

    There is only one submit button, so searching all of the INPUT tags for the one that is of Type = "submit" will do the job, maybe something like this ...

        for each tag in oIE.document.body.all.tags("input")
          if lcase(tag.type) = "submit" then tag.click : exit for
        next ' tag


    Tom Lavedas
    Monday, November 08, 2010 9:30 PM
    Moderator
  • Or What if we found all the tags via type like submit button and filter it out with the value like "Log in" or something (the text written on the button).

    If we can do this then it will be great...

     

    Thanks

    :)

    Tuesday, November 09, 2010 2:40 PM
  • I'm not quite certain what you mean.  I don't know of any DHTML method to access controls by their type.  I just checked the MS reference materials and I didn't recognize one that would do that.  That's why I did the search by HTML tag name.  If you mean that once a SUBMIT type was located it could be confirmed as the right one by checking its value, then, Yes, that is probably a good strategy, something like this ...

        for each tag in oIE.document.body.all.tags("input")
          if lcase(tag.type) = "submit" then
            if instr(lcase(tag.value), "log in") > 0 then tag.click : exit for
          end if
        next ' tag

    Tom Lavedas
    Tuesday, November 09, 2010 5:43 PM
    Moderator
  • Thank you so much Tom.

     

    I'll test it out and will update you with the results.

     

    Once again a nice and valuable help.

    Thursday, November 11, 2010 7:15 AM
  • Thanx a lot for this code Tom.  I am a newbee in this subject and I am trying to implement your code to a secure site https://www.licindia.in/epslogin.htm, but unable to locate the designations of IDToken1, IDToken2 and the submit button.  Plus while running the code, I am getting a complile error with the "unescape" function stating 'Sub or Function not defined.'  Could you please help me in this regard.

    Thanx in advance once again. 

    Thursday, December 02, 2010 6:07 AM
  • Hey Tom,

     

    Just wanted to say to Thank You again. I've developed the final version of the script and yes the fact is, i started with your guidance and was able to achieve the goal.

    What the script does:

    1) Reads server name from a list file one at a time

    2) bypass certificate error page if any

    3) logins to the website

    4) reports the status in a status file

    5) Logs all of the activities in a log file

    In case you need the script then i'll send it across to you.

    Tuesday, December 14, 2010 10:22 AM
  • Hey can you please forward me the code or script for the login into a website. I have a python script which is suppose to log me into a website automatically but the script i snot working. I was trying to look if we can do it using java. If you send me the script that will be great.

     

    Thanks

    Nusrat

     

    Sunday, March 27, 2011 6:32 AM
  • Hi Anuj,

    I am new to web programming (been studying for 10 days now) and I really want to analyze the script construction for your program. Can I also get a copy of your "Auto Login Script"?

     

    Thanks :-)

    Saturday, November 12, 2011 1:57 AM
  • please forward script to me @ shreenath22@hotmail.com
    Friday, February 17, 2012 3:27 AM
  • This is one of those more difficult cases where the tag needs to be located by some other characteristic than its ID or Name, because the element has neither an ID or a name.

    There is only one submit button, so searching all of the INPUT tags for the one that is of Type = "submit" will do the job, maybe something like this ...

        for each tag in oIE.document.body.all.tags("input")
          if lcase(tag.type) = "submit" then tag.click : exit for
        next ' tag


    Tom Lavedas

    It all work apart from the submit button, which is not activated.

    Help, the page code is:

    </div>
        <div class="submit clear">
          <button value="submit" class="submit"><span>Sign In</span></button>
        </div>

      </div>


    Ian

    Thursday, May 09, 2013 8:35 AM
  • In this case, you need to search for a "button" tag, rather than an "input" tag.  In addition, the sub-search needs to check for a "value="submit", maybe something like this ...

       for each tag in oIE.document.body.all.tags("button")
          if lcase(tag.value) = "submit" then 
            tag.click
            exit for
          end if
        next ' tag


    Tom Lavedas

    • Proposed as answer by Ian MR Friday, May 10, 2013 7:45 AM
    Thursday, May 09, 2013 12:48 PM
    Moderator
  • Thankyou very much - worked great.

    Ian

    Friday, May 10, 2013 7:49 AM