annonimous has asked for the wisdom of the Perl Monks concerning the following question:
then on my linux box im getting something like click_button: No form has been selected at ./mech.pl line 9 in the code of the webpage i have it is showing:#!/usr/bin/perl # use strict; use WWW::Mechanize; my $target = "http://www.somewebpage.com/subscription/showsubscribe"; my $mech = WWW::Mechanize->new(agent=>$useragent); $mech->get($target); my $response = $mech->click_button(value=>"subscriptionTop", value=>"loadingSubscript +ion();"); $mech->submit(); die "Error at '$target'\n", $response->status_line, "\n Aborting" unless $response->is_success; $response = $mech->response; for my $key ($response->header_field_names()) { print "response[$key] = ", $response->header($key), "\n"; } #print $mech->content;
any tip of where it is my fault? im reading in the cpan about www::mechanize but i cant get how to click on this link thanks for your help!<input type="image" src="/image/suscribe-btn.png;jsessionid=uK6psR994V +LpkeMzmEEVte9n" onclick="loadingSubscription();" class="img_content_i +mg_home" id="subscriptionTop">
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Click on "any" href
by choroba (Cardinal) on Mar 05, 2015 at 09:08 UTC | |
by annonimous (Novice) on Mar 05, 2015 at 18:10 UTC | |
by Anonymous Monk on Mar 05, 2015 at 21:16 UTC | |
by Anonymous Monk on Mar 06, 2015 at 03:52 UTC | |
|
Re: Click on "any" href
by vinoth.ree (Monsignor) on Mar 05, 2015 at 08:43 UTC | |
by annonimous (Novice) on Mar 05, 2015 at 18:09 UTC |