title: AutoIT IE logging in not finding objects
body: <p>I got AutoIt to work with my router login page. However for our HP Pro Curve Switch.. I can't get it to work...</p>
  
  <pre><code>#NoTrayIcon
  #include &lt;ie.au3&gt;
  $Address = "http://10.255.96.2/index.html"
  $pwd="mypassword"
  
  $oIE = _IECreate ($Address)
  _IELoadWait($oIE)
  $oForm = _IEFormGetObjByName ($oIE, "maindata")
  
  for $stuff in $oForm
  if $stuff.name = "password" and $stuff.type = "password" then _IEFormElementSetValue ($stuff, $pwd)
  If $stuff.value == "Login" and $stuff.type = "submit" Then $stuff.click
  Next
  
  exit
  </code></pre>
  
  <p>I get "H:\loginToSwitch.au3" (10) : ==> Variable must be of type "Object".:</p>
  
  <p>Basically the "maindata" is incorect.</p>
  
  <p>Here is the HTML if I right click on the page and view source:</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;
  &lt;html&gt;&lt;head&gt;
  &lt;meta name=Copyright content="Copyright (c) 2005 HP Networks, Inc. All Rights Reserved."&gt;
  &lt;meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"&gt;
  &lt;meta http-equiv="Pragma" content="no-cache"&gt;
  &lt;title&gt;HP Networks Web Interface&lt;/title&gt;
  &lt;script src="/mainjs.js" language=javascript type="text/javascript"&gt;&lt;/script&gt;
  &lt;script language="javascript" type="text/javascript"&gt;
  //&lt;!--
  checkFrame();   // Ensure we are not within a frame
  implementLoginFrames('login.html');
  document.write('&lt;noframes&gt;');
  //--&gt;
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body BGCOLOR="#DAE3EB"&gt;
  &lt;center&gt;
  &lt;font color="#008BD1" face="Arial, Helvetica, sans-serif"&gt;&lt;B&gt;Please ensure that your browser supports Frames and Javascript, and that they are both enabled.&lt;/b&gt;&lt;/font&gt;
  &lt;/center&gt;
  &lt;script language="javascript" type="text/javascript"&gt;
  //&lt;!--
  document.write('&lt;\/noframes&gt;');
  //--&gt;
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>However, when I use firefox to identify elements... it gives me a completely different code (which is what I got the buttons and textbox info from):</p>
  
  <pre><code>    &lt;html&gt;
      &lt;head&gt;&lt;/head&gt;
      &lt;frameset framespacing="0" border="0" frameborder="0" rows="80,*"&gt;
          &lt;frameset framespacing="0" border="0" frameborder="0" cols="*,22"&gt;&lt;/frameset&gt;
          &lt;frame src="login.html" noresize="" name="loginFrame" scrolling="auto"&gt;
              #document
                  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;
                  &lt;html&gt;
                      &lt;head&gt;&lt;/head&gt;
                      &lt;body onload="loadConfiguration();"&gt;
                          &lt;script type="text/javascript" language="javascript"&gt;&lt;/script&gt;
                          &lt;form onsubmit="return login();" name="tF" method="post" action="login.html"&gt;
                              &lt;table class="container" style="height: 650px"&gt;
                                  &lt;tbody&gt;
                                      &lt;tr&gt;
                                          &lt;td class="container"&gt;
                                              &lt;div class="container"&gt;
                                                  &lt;div class="loginbox"&gt;
                                                      &lt;!--
  
                                                       Login box HTML code here... 
  
                                                      --&gt;
                                                      &lt;table class="login"&gt;
                                                          &lt;tbody&gt;
                                                              &lt;tr&gt;
                                                                  &lt;td id="devname" class="hdr style2" style="color: #ffffff; font-family: Arial, Helvetica, sans-serif;" colspan="2"&gt;&lt;/td&gt;
                                                              &lt;/tr&gt;
                                                              &lt;tr&gt;
                                                                  &lt;td class="hdr style2" valign="top"&gt;&lt;/td&gt;
                                                                  &lt;td class="maindata"&gt;
                                                                      &lt;input id="password" type="password" onkeypress="capsCheck(event);" size="20" name="password" maxlength="16"&gt;&lt;/input&gt;
                                                                      &lt;script type="text/javascript" language="javascript"&gt;&lt;/script&gt;
                                                                      &lt;input class="button" type="submit" style="position: relative; top: 2;" value="Login"&gt;&lt;/input&gt;
                                                                      &lt;br&gt;&lt;/br&gt;
                                                                      &lt;span id="passwd" class="default" style="display: none;"&gt;&lt;/span&gt;
                                                                  &lt;/td&gt;
                                                              &lt;/tr&gt;
                                                              &lt;tr&gt;&lt;/tr&gt;
                                                              &lt;tr&gt;&lt;/tr&gt;
                                                          &lt;/tbody&gt;
                                                      &lt;/table&gt;
                                                      &lt;span id="wrong" class="warning" style="display: none;"&gt;&lt;/span&gt;
                                                      &lt;br&gt;&lt;/br&gt;
                                                      &lt;span id="capsmsg" class="warning" style="display: none;"&gt;&lt;/span&gt;
                                                      &lt;br&gt;&lt;/br&gt;
  
  
                                                      It is recommended that you use a minimum of
  
                                                      &lt;br&gt;&lt;/br&gt;
  
                                                      Microsoft® Internet Explorer 5.5 to view the Inter…
  
                                                      &lt;br&gt;&lt;/br&gt;
                                                      &lt;br&gt;&lt;/br&gt;
                                                      &lt;!--
  
                                                       Login box HTML end... 
  
                                                      --&gt;
                                                  &lt;/div&gt;
                                              &lt;/div&gt;
                                          &lt;/td&gt;
                                      &lt;/tr&gt;
                                  &lt;/tbody&gt;
                              &lt;/table&gt;
                              &lt;script type="text/javascript" language="javascript"&gt;&lt;/script&gt;
                          &lt;/form&gt;
                      &lt;/body&gt;
                  &lt;/html&gt;
          &lt;/frame&gt;
      &lt;/frameset&gt;
      &lt;noframes&gt;&lt;/noframes&gt;
  &lt;/html&gt;
  </code></pre>