bluesplay106 has asked for the wisdom of the Perl Monks concerning the following question:

This is the website I'm having problems with : http://downloadcenter.netgear.com/en/default.aspx So I'm not sure how I'm supposed to fill in the form for this type of aspx website. It's like a click choose type format. I'm looking at the html page source and I have no clue where to start. I'm trying to use WWW::Mechanize.
  • Comment on Trying to use WWW::Mechanize for aspx websites

Replies are listed 'Best First'.
Re: Trying to use WWW::Mechanize for aspx websites
by bluesplay106 (Novice) on Jun 12, 2013 at 19:42 UTC
    Okay, so I found that some of the forms input is "hidden". I'm not sure what that means and what I'm supposed to input. Oh, I forgot to mention that I'm trying to make a crawler if that wasn't clear.

      Hidden controls are simply not shown on the page, but their labels and values are sent to the server when the form is submitted. So you just use them as if they were not hidden:

      <input name="foo" type="hidden" /> <input name="bar" type="text" />
      They are both treated the same when the server receives their values: http://server.com/path/to/form?foo=1&bar=1

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)
      
        I don't know how much it's necessary to worry about 'hidden' variables - unless you're wanting to manipulate them at any rate.

        WWW::Mechanize is quite good about letting you ... well, 'do the same was you would on the page'.

        Unfortunately, the problem here is that that page quoted is javascript. WWW::Mechanize doesn't 'do' javascript. (Although as it mentions - sometimes a form will work despite having ugly javascript obfuscating it) FAQ

        So I found this and I have no idea what kind of value they want :
        /title></head> <body> <form name="aspnetForm" method="post" action="default.aspx" id=" +aspnetForm"> <div> <input type="hidden" name="ctl00_ctl00_ctl00_scriptmngr_HiddenField" i +d="ctl00_ctl00_ctl00_scriptmngr_HiddenField" value="" /> <input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" /> <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" +/> <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value +="" /> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDw +ULLTIxM" /> </div>