Hi perl monks, im a new soul looking for wisdom im making a simple WWW::Mechanize routine here it is my code:
#!/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;
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:
<input type="image" src="/image/suscribe-btn.png;jsessionid=uK6psR994V +LpkeMzmEEVte9n" onclick="loadingSubscription();" class="img_content_i +mg_home" id="subscriptionTop">
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!

In reply to Click on "any" href by annonimous

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.