title: powershell script for the website with the following page script/source
body: <p>I want to automate my internet service provider login page so that the WiFi remains connected all the way.</p>
  
  <pre><code>$url="http://login.hireachbroadband.com/login"
  $username="username"
  $password="password"
  $ie=New-Object -com internetexplorer.application;
  $ie.visible = $true;
  $ie.navigate($url);
  while ($ie.Busy -eq $true)
  {
  Start-Sleep -Milliseconds 1000;
  }
  $ie.Document.getElementById("username").value=$username
  $ie.Document.getElementByID("password").value=$password
  $document.getElementsByID("btn btn-success btn-lg btn-block").Click();
  $submitButton.click()
  $cmd.Quit();
  </code></pre>
  
  <p>the webpage has following page source</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;!-- saved from url=(0034)http://demo.kangndo.com/kangndo19/ --&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;meta http-equiv="pragma" content="no-cache" /&gt;
  &lt;meta http-equiv="expires" content="-1" /&gt;
  &lt;meta http-equiv="Pragma" content="No-Cache"&gt;
  &lt;meta http-equiv="Cache-Control"
      content="No-Cache,Must-Revalidate,No-Store"&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;ReachBroadband :: Login&lt;/title&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
  &lt;meta name="description" content=""&gt;
  &lt;meta name="author" content=""&gt;
  
  &lt;link href="css/bootstrap.min.css" rel="stylesheet"&gt;
  &lt;link href="css/style.css" rel="stylesheet"&gt;
  &lt;script src="jquery-1.9.1.js"&gt;&lt;/script&gt;
  &lt;script&gt;
              $(function() {
  
                  if (localStorage.chkbx &amp;&amp; localStorage.chkbx != '') {
                   //   alert('localStorage.chkbx : '+ localStorage.chkbx)
                      $('#remember_me').attr('checked', 'checked');
                      $('#username').val(localStorage.usrname);
                      $('#pass').val(localStorage.pass);
                  } else {
                      $('#remember_me').removeAttr('checked');
                      $('#username').val('');
                      $('#pass').val('');
                  }
  
                  $('#remember_me').click(function() {
  
                      if ($('#remember_me').is(':checked')) {
                          // save username and password
                          localStorage.usrname = $('#username').val();
                          localStorage.pass = $('#pass').val();
                          localStorage.chkbx = $('#remember_me').val();
                      } else {
                          localStorage.usrname = '';
                          localStorage.pass = '';
                          localStorage.chkbx = '';
                      }
                  });
  
              });
  function onsubmitform(){
  
       if ($('#remember_me').is(':checked')) {
           // save username and password
           localStorage.usrname = $('#username').val();
           localStorage.pass = $('#pass').val();
           localStorage.chkbx = $('#remember_me').val();
       } else {
           localStorage.usrname = '';
           localStorage.pass = '';
           localStorage.chkbx = '';
       }
       return true;
  }
          &lt;/script&gt;
  
  
  
  &lt;!--[if lt IE 9]&gt;
   &lt;script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"&gt;&lt;/script&gt;
   &lt;![endif]--&gt;
  &lt;/head&gt;
  &lt;!-- /HEAD--&gt;
  &lt;body data-spy="scroll" data-target=".navbar" style=""&gt;
  
  &lt;nav id="topnav" class="navbar navbar-fixed-top navbar-inverse"
      role="navigation"&gt;
  &lt;div class="container"&gt;
  &lt;div class="navbar-header"&gt;
  &lt;button type="button" class="navbar-toggle" data-toggle="collapse"
      data-target=".navbar-ex1-collapse"&gt;&lt;span class="sr-only"&gt;Toggle
  navigation&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt;
  &lt;span class="icon-bar"&gt;&lt;/span&gt;&lt;/button&gt;
  &lt;a class="navbar-brand" href="javascript:void(0);"&gt;&lt;img
      src="logo.png" style="width: 150px" /&gt;&lt;/a&gt;&lt;/div&gt;
  
  &lt;div class="collapse navbar-collapse navbar-ex1-collapse"&gt;
  &lt;ul class="nav navbar-nav"&gt;
  
  &lt;/ul&gt;
  &lt;div class="nav navbar-nav navbar-right"&gt;
  &lt;div class="kangndo"&gt;&lt;strong&gt;Please call customer care if
  you have any issues : 96422 12345&lt;/strong&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/nav&gt;
  
  
  &lt;!-- HEADER --&gt;
  &lt;header id="top-section"&gt;
  &lt;div class="jumbotron"&gt;
  &lt;div class="container"&gt;
  &lt;div class="row"&gt;
  &lt;div class="text-left col-xs-12 col-sm-4 col-lg-4"
      style="padding-right: 30px;"&gt;&lt;!-- FORM--&gt;
  &lt;div&gt;
  &lt;div class="panel"&gt;
  &lt;div class="panel-heading text-center "&gt;&lt;strong&gt;Hotspot
  Login&lt;/strong&gt;&lt;/div&gt;
  &lt;div class="panel-body"&gt;
  &lt;form name="login" action="http://login.hireachbroadband.com/login" method="post"
                          &gt;
  &lt;fieldset&gt;
  &lt;p class="text-center" style="font-size:14px;"&gt;&lt;small&gt;&lt;br /&gt;
  Note : Your default Password is &lt;strong&gt;123456&lt;/strong&gt;. If you want to change your password please click on My Account&lt;/small&gt;&lt;/p&gt;
  &lt;div class="form-group"&gt;&lt;label for="exampleInputEmail"&gt;User
  name&lt;/label&gt; &lt;input type="text" class="form-control" id="username"
      name="username" autofocus="" value=""&gt;&lt;/div&gt;
  &lt;div class="form-group"&gt;&lt;label for="exampleInputPassword"&gt;Password&lt;/label&gt;
  &lt;input type="password" name="password" class="form-control"
      id="pass"&gt;&lt;/div&gt;
       &lt;label class="checkbox"&gt;
                      &lt;input type="checkbox" value="1" id="remember_me"&gt; Remember me
                  &lt;/label&gt;
  &lt;button type="submit" class="btn btn-success btn-lg btn-block"&gt;Sign
  In&lt;/button&gt;
  
  &lt;/fieldset&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;div class="panel-footer"&gt;
  &lt;p&gt;&lt;a href="http://myaccount.hireachbroadband.com/login.php"
      class="btn btn-success btn-lg btn-block" target="_blank"&gt;My Account&lt;/a&gt;
  &lt;/p&gt;
  
  
  
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;!-- / FORM --&gt;&lt;/div&gt;
  &lt;div class="col-xs-12 col-sm-8 col-md-8 col-lg-8 text-center"&gt;
  &lt;h3&gt;High Speed Internet Access&lt;/h3&gt;
  &lt;h4&gt;Fast, Reliable, Affordable&lt;/h4&gt;
  &lt;hr&gt;
  
  &lt;/div&gt;
  &lt;/div&gt;
  
  
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/header&gt;
  &lt;!-- / HEADER --&gt;
  
  
  
  
  
  
  
  &lt;br&gt;
  
  &lt;script type="text/javascript"&gt;
  &lt;!--
    document.login.username.focus();
  //--&gt;
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>