in reply to Re^4: WWW::Mechanize::PhantomJS can't click button
in thread WWW::Mechanize::PhantomJS can't click button

You will have better results when you set a user-agent string and/or a file for persisting cookies like so:

my $mech = WWW::Mechanize::PhantomJS->new( 'cookie_file' => 'cookies.txt' ); $mech->add_header( # use a proper string from somewhere or your own browser 'User-Agent' => 'Mozilla/5.0 ... bla bla bla' );

I said "and/or cookie file" because I could not find the cookie file on current dir - i don't know where it may be stored if at all

Regarding POSTing with LWP, it seems viable.

bw, bliako

Replies are listed 'Best First'.
Re^6: WWW::Mechanize::PhantomJS can't click button
by tel2 (Pilgrim) on May 02, 2021 at 09:00 UTC
    Thanks again, bliako.  I might try that sometime.  I seem to recall trying cookies last year when I was trying to get this working, but I should make sure and also try changing the user-agent as you've suggested.

      for the record, what I suggested worked for me. What was important was the UA string, cookies-file did not make a difference and did not see them saved on disk. PhantomJS seems to keep session cookies on memory. So that angle is covered. You need to be explicit on UA though.