asp.net mvc - Not able to POST ASP-NET form with WWW::Mechanize or LWP::UserAgent -


i need automate extraction of products catalog, authorized distributors. company ingram micro , they're huge, don't provide simple way (like web service) query catalog , stock, we've been extracting lwp::useragent far, daily, our online store database.

recently, changed website, , there's can't detect preventing perl script doing succesful login. if try directly on browser, login succesfully, if try submiting form perl, login page again (like unsuccessful login).

their site made on aspnet , full of hidden form fields generated asp. @ first, doing own 'spider' login page, read hidden field values , include them in post login request along username , password, now, after problem, started using www::mechanize requests , have task automated correctly.

however, not www::mechanize or lwp::useragent able succesful login.

i've tried looking @ exact http conversation between browser , server, , including same exact headers on automated request correct post content, , doing unsuccesful login perl , succesful login browser.

i'm desperate, cannot detect problem , not able run store without catalog update.

you can see login page here: https://www.imstores.com/ingrammicromx/

please, if has experience similar issue or can @ page , detect makes browser different www::mechanize request, please let me know.

thank you.

usually use way test what's wrong:

  1. clear cookies in browser
  2. disable javascript
  3. open login page
  4. try login

if have success login can www::mechanize without additional tricks, don't forget use button => "submit_button_name" this:

$mech->submit_form(     with_fields => {         login_field_field => $login,         password_field_name => $password,     },     button => "submit_button_name", ); 

even if can't login browser javascript disabled still can mechanize need @ browser's http request (i use httpfox this) , make exactly same request (including headers) mechanize.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -