After further testing I verified the following:

1. I am using WWW-Mechanize-Chrome-0.65
2. I am using Chrome 87.0.4280.141 (Official Build) (64-bit)
3. Adding the $mech->sleep(5); after the $post_response->is_success || die $post_response->status_line; as you have done above fixed my problem. Is this sleep() call always necessary after a get() due to the following (taken from the documentation):

Note that the returned HTTP::Response object gets the response body filled in lazily, so you might have to wait a moment to get the response body from the result. This is a premature optimization and later releases of WWW::Mechanize::Chrome are planned to fetch the response body immediately when accessing the response body.

Finally, I noticed that if I change this line:

$mech->click({id => 'ProductSelect-option-color-solar-8568844557'});

to the following:

my $response = $mech->click({id => 'ProductSelect-option-color-solar-8 +568844557'}); $mech->sleep(5); print Dumper($response); if ($response->is_success) { printf("click succeeded\n"); }

the output is:

> ./www_mechanize_chrome_testcase.pl $VAR1 = []; Can't call method "is_success" on unblessed reference at ./www_mechani +ze_chrome_testcase.pl line 27.

Is that expected? If $mech->click() returns an HTTP::Response object, shouldn't I be able to call the is_success method?


In reply to Re^2: help clicking radio buttons using WWW::Mechanize::Chrome by Special_K
in thread help clicking radio buttons using WWW::Mechanize::Chrome by Special_K

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.