title: Download a homepage where a POST argument is beeing generated from javascript
body: <p>Did a lot of research but now im sadly completly stuck.</p>
  
  <p>I need to download a html page:
  For this I fill out different data in a formular and click the submit button, then I would like to save the responses.</p>
  
  <p>Using Firebug i can see that my data is filled out and send over POST. Unluckily there is one more argument that i cannot trace down <strong>how</strong> it is generated, and without this last argument I don't get the adequate html response, but an error page.</p>
  
  <p>wget and curl (cookies,useragent,header,referrer) fails without last parameter!</p>
  
  <p>Im not too familiar with jquery and javascript, so I cant really where data comes from, but if the browser knows it I should be able as well!</p>
  
  <p>I found this to be similar, only mine seems harder as the field is generated: <a href="https://stackoverflow.com/questions/21576518/wget-get-field-info-before-sending-post-data?rq=1">wget : get field info before sending post-data</a></p>
  
  <p>In my case I traced it down to this:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function(){
  $.get('/getmyData.asp?str=erServiceXUVC',function(string){
  $('#oikuZR').append('&lt;input type="hidden" name="lsXUVp" value="'+ string +'"&gt;');
  });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>And the difference from using a real browser and wget (even with user agent and stuff) is because I cannot acces this value, that shows up if I use the normal browser.</p>
  
  <pre><code>&lt;input type="hidden" value="34928321" name="lsXUVp"&gt;
  </code></pre>
  
  <p>This is exactly the value I need (comparing to firebug POST)! But....</p>
  
  <p>Here my knowledge ends.</p>
  
  <ul>
  <li>Cannot find "34928321" in the code</li>
  <li>"#oikuZR" doesnt show up in the DOM list of firebug, but maybe I'm doing something wrong (there are thousands of entries)</li>
  <li>Debugging the above script I can see that string=34928321 as local variable but I don't see from where the function is beeing called</li>
  <li>If I open www.homepage.com/getmyData.asp?str=erServiceXUVC (with or without params) there is just an error page.</li>
  </ul>
  
  <p>Thought about using <a href="http://splash.readthedocs.org" rel="nofollow noreferrer">Splash</a> as proxy to run the javascript for me, and than wget that page, but since I dont understand the mechanics yet Im doubtful.</p>
  
  <p>So what can I do?</p>
  
  <p>Maybe a javascript capable browser that accepts commands from command line: open, fillout, send, saveHtml? Alternatives? Solutions for wget (favorite!)?</p>