Re: Getting a specific page using WWW::Mechanize [SOLVED]

2017-04-25 Thread SSC_perl
I found my error. I ended up using $mech->save_content(‘result.html’) at the end of my script and, lo and behold, it produced the confirm.htm page with an error. I had forgotten to add the cardholder’s name field to the final form submission, so of course, SurfShop was returning the sa

Re: Getting a specific page using WWW::Mechanize

2017-04-25 Thread SSC_perl
> On Apr 25, 2017, at 10:09 AM, Chas. Owens wrote: > > Are you using JavaScript to redirect the user to the sorry page? Nope. All navigation is handled by perl. Thanks for the link, though. Frank

Re: Getting a specific page using WWW::Mechanize

2017-04-25 Thread Chas. Owens
Are you using JavaScript to redirect the user to the sorry page? If so then WWW::Mechanise won't redirect. It doesn't understand JavaScript. Happily, there are drop in replacements for it that do: http://search.cpan.org/~oalders/WWW-Mechanize-1.84/lib/WWW/Mechanize/FAQ.pod#Which_modules_work_lik

Re: Getting a specific page using WWW::Mechanize

2017-04-25 Thread SSC_perl
Here’s more information on this situation. SurfShop uses two main HTML templates, main.htm and secure.htm. Then there are sub-templates that get loaded as the content of those two main templates. During checkout, secure.htm is used. If the order is successful, receipt.htm is

Getting a specific page using WWW::Mechanize

2017-04-25 Thread SSC_perl
I’ve written a script using WWW::Mechanize to place test orders in SurfShop. I wish I had know it could do this before. :\ For some reason, I was under the impression that it was only good for scraping. The script works great, but I need to find a way to get the contents of