CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [ferulebezel] Can't seem to do a POST request.: Edit Log



wickedxter
User

Oct 20, 2012, 7:58 PM


Views: 1620
Re: [ferulebezel] Can't seem to do a POST request.


Code
 
use strict;
use warnings;

use WWW::Mechanize;

my $mech = WWW::Mechanize->new();

$mech->agent_alias('Windows Mozilla');

$mech->get('http://www.textbooks.co/BuyBack-Search.php');

#this selects the search box
$mech->form(1);

$mech->set_feilds(
price_group => 'buy',
key_val => $bookData{'searchNumber'},
);
#submit the form data
$mech->submit();

#get the page content
my $content = mech->content();


i like useing WWW::Mechanize which makes things easier to do.. this is untested... When looking at the page source their was some jave script call backs for the fourm that on submit it checked something but dont know what. So youll have to tinker with this..


(This post was edited by wickedxter on Oct 20, 2012, 7:58 PM)


Edit Log:
Post edited by wickedxter (User) on Oct 20, 2012, 7:58 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives