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:
- clear cookies in browser
- disable javascript
- open login page
- 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
Post a Comment