in reply to Trying to use WWW::Mechanize for aspx websites

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.
  • Comment on Re: Trying to use WWW::Mechanize for aspx websites

Replies are listed 'Best First'.
Re^2: Trying to use WWW::Mechanize for aspx websites
by jeffa (Bishop) on Jun 12, 2013 at 19:46 UTC

    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

        Yes to Preceptor's words ;)
        If you knew more what you were looking for in the site, I could help. I have had a lot of crawling experience recently and wrote a basic tutorial on www::mechanize for perlmonks a couple weeks ago
      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>