drblove27 has asked for the wisdom of the Perl Monks concerning the following question:
I am attempting to search AbeBooks for the book "Codex Seraphinianus" from the main page (AbeBooks). Here is the code that I am using:
But this just sends me back the content of the advanced search page not the results page. I guess I really have two questions,#!/usr/bin/perl -w use strict; use LWP; my $browser = LWP::UserAgent->new( agent => 'Mozilla/5.0 (Windows; U; +Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0' ); $browser->cookie_jar({}); my $response = $browser->post( 'http://www.abebooks.com/servlet/SearchEntry', # That's the URL that the real form submits to. [ "bi" => "0", "bx" => "off", "ds" => "30", "sortby" => "2", "sts" => "t", "tn" => "Codex+Seraphinianus", "x" => "43", "y" => "10", ] ); print $response->content;
1) Is there a way to check the http header that goes to the request? I want to check the header versus when I do it in the Firefox browser (with the idea that will help me debug my code in the future)
2) How do I fix my code to get back to the proper results page?
Updated For what it is worth, there is JavaScript on the page, so that is a fun kick in the pants...
Cheers
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP Post Question
by marcussen (Pilgrim) on Jul 17, 2008 at 01:36 UTC | |
by drblove27 (Sexton) on Jul 17, 2008 at 01:46 UTC | |
by runrig (Abbot) on Jul 17, 2008 at 17:00 UTC | |
by drblove27 (Sexton) on Jul 18, 2008 at 00:12 UTC | |
by runrig (Abbot) on Jul 18, 2008 at 00:26 UTC | |
|
Re: LWP Post Question
by runrig (Abbot) on Jul 17, 2008 at 00:06 UTC | |
by drblove27 (Sexton) on Jul 17, 2008 at 00:12 UTC | |
|
Re: LWP Post Question
by Anonymous Monk on Jul 17, 2008 at 03:25 UTC | |
|
Re: LWP Post Question
by Gary Yang (Acolyte) on Jun 14, 2011 at 00:19 UTC |