Corion / WWW-Mechanize-Chrome

automate the Chrome browser
https://metacpan.org/release/WWW-Mechanize-Chrome
Artistic License 2.0
30 stars 12 forks source link

Can't locate object method "cookie_jar" via package "WWW::Mechanize::Chrome" #40

Closed KES777 closed 5 years ago

KES777 commented 5 years ago

I use WWW::Mechanize::Chrome to produce pdf from urls.

at https://metacpan.org/pod/HTTP::CookieMonster I found example from SYNOPSYS:

use HTTP::CookieMonster;

my $monster = HTTP::CookieMonster->new( $mech->cookie_jar );

and get the error:

Can't locate object method "cookie_jar" via package "WWW::Mechanize::Chrome" at

How to setup cookies for WWW::Mechanize::Chrome?

Corion commented 5 years ago

The commit above (to be released in v0.29, on its way to CPAN) adds a ->cookie_jar method that returns a prefilled cookie jar. I don't know what you want to do with it and what HTTP::CookieMonster does. Randomly trying to call methods that are not even documented on an object is not a strategy for success.

sdondley commented 5 years ago

I think probably part of the confusion might be that one might expect the methods from WWW::Mechanize to be inherited. I know I wondered the same thing: https://metacpan.org/pod/WWW::Mechanize#cookie_jar

KES777 commented 5 years ago

@Corion I was trying to setup cookies for the request. Tried to login to a site