title: Wget post data with text box that has randomly generated value?
body: <p>I'm trying to use Wget to log in to my router and make a complete mirror of all the pages. The problem is, the router login page does not use the traditional "user" &amp; "pass" ID for the text fields. It has a 'Password' and 'VmWpsPin' field. The ID for the 'Password' field is randomly generated every time the page is loaded/refreshed/requested. Below is the source code of the relevant part of the router page:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body lang="en" class="superhubGUI" onload="javascript:Init()"&gt;
    &lt;div class="globalHeader"&gt;
      &lt;div id="nav"&gt;
        &lt;div id="logo"&gt;
          &lt;h1 id="header"&gt;Super Hub&lt;/h1&gt;
        &lt;/div&gt;
        &lt;div id="buttons"&gt;&lt;a href="../RouterStatus.html" class="routerStatus"&gt;Router Status&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div id="content"&gt;
      &lt;div id="container"&gt;
        &lt;div id="main"&gt;
          &lt;div class="panel noTitle" style="*padding:38px 30px 0px 30px"&gt;
            &lt;div id="login" class="inner"&gt;
              &lt;div class="inner-section"&gt;
                &lt;h2&gt;Welcome to your Virgin Media Super Hub 2ac&lt;/h2&gt;
                &lt;div id="signInForm"&gt;
                  &lt;form action="/cgi-bin/VmLoginCgi" method="POST" name="signIn1" id="signIn"&gt;
                    &lt;h2 id="loginTitle"&gt;Sign in to view and change your settings&lt;/h2&gt;
                    &lt;div class="field formField noHint username clearfix"&gt;
                      &lt;label for="username"&gt;&lt;/label&gt;
                    &lt;/div&gt;
                    &lt;div style="position:relative;top:-20px;" class="field formField noHint password clearfix"&gt;
                      &lt;label for="password"&gt;Settings Password&lt;/label&gt;
                      &lt;input type="password" autocomplete="off" value="" maxlength="15" class="name required onefiftyPX inactive" name="KsCAqiihZb" id="password" onkeypress="handleKeyPress(event)" /&gt;
                      &lt;div style="position:relative;left:-10px;" class="tooltip"&gt;
                        &lt;img style="position:absolute; top:10px;" src="../images/toolTipButton.png"&gt;&lt;span&gt;Password can be found on the base of your Super Hub&lt;/span&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;div style="position:relative;top:-25px;" class="field formField noHint password clearfix"&gt;
                      &lt;label for="password"&gt;WPS PIN&lt;/label&gt;
                      &lt;input type="text" autocomplete="off" value="" maxlength="15" class="name required onefiftyPX inactive" name="VmWpsPin" id="WpsPin" onkeypress="handleKeyPress(event)" /&gt;
                      &lt;div style="position:relative;left:-10px;" class="tooltip"&gt;
                        &lt;img style="position:absolute; top:10px;" src="../images/toolTipButton.png"&gt;&lt;span&gt;WPS PIN can be found on the base of your Super Hub&lt;/span&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;div&gt;
                      &lt;a href="javascript:SignIn()" class="newCta ctaLarge ctaPrimaryLarge floatLeft"&gt;Sign In&lt;/a&gt;
                    &lt;/div&gt;
                  &lt;/form&gt;
                  &lt;p&gt;
                    &lt;span style="font-weight:bold;"&gt;Don't know your password?&lt;/span&gt;
                    &lt;br/&gt;You'll find your default password on the bottom of your Super Hub.
                  &lt;/p&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;&lt;span class="pFoot"&gt;&amp;nbsp;&lt;/span&gt;
          &lt;/div&gt;
        &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>My question is, how can I use Wget to login to the router when the ID changes at every request, is there somehow a way to request the page, parse the value out and then submit the form using something like --keep-session?</p>
  
  <p>Or is there an alternative solution outside of Wget to automate the process? Any help is much appreciated.</p>