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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
Perl Program to click on 'Add to Cart' image and submit


New User

Oct 4, 2008, 4:34 PM

Post #1 of 1 (6770 views)
Perl Program to click on 'Add to Cart' image and submit Can't Post

I am trying to write a perl script that will select a product to shop from a website, enter quantity, add to cart and checkout. I have been able to select the product but i am not able to submit the 'add to cart'. The 'add to cart' is an image instead of a button. I am using POST but it is not working. Here is part of the code i am using:

my $url = ";
my $browser = LWP::UserAgent->new;
resp = $browser->post($url,
['Cart_Qty' => 'form.submit()']);

Section of the HTML code:
<form name="Cart_Qty" action=";cPath=2&amp;prod_no=1&amp;action=add_product" method="post" enctype="multipart/form-data">

<div id="cartAdd">
Add to Cart: <input type="text" name="Cart_Qty" value="1" maxlength="6" size="4" /><br /><br /><input type="hidden" name="prod_no" value="8" /><input type="image" src="includes/templates/template_default/buttons/english/button_in_cart.gif" alt="Add to Cart" title=" Add to Cart " /> </div>

Appreciate any help with this. Thanks!


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

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