I have a script that scrapes my scores from an website. This website uses my Facebook account for logging in. Since a few days the script does not work anymore and I get the following error:
Cookies Required: Cookies are not enabled on your browser. Please enable cookies in your browser preferences to continue.
I searched on this forum and I found a similar problem: I tryed the given solution but it did not work.
I have export my FaceBook login cookies.txt from Google Chrome with this plugin. https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg?hl=en and save the cookies.txt in the same folder as the script:
use WWW::Mechanize;
use use HTTP::Cookies::Netscape;
my $mech = WWW::Mechanize->new( cookie_jar => HTTP::Cookies::Netscape->new( file => $cookies.txt ) );
$mech->agent_alias('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0');
$mech->get("https://www.facebook.com/login.php");
$mech->submit_form(
fields => {
email => '<my email here>',
pass => '<my password here>',
}
);
open($out, ">", "output_page.html") or die "Can't open output_page.html: $!";
print $out $mech->content;
In the script I use Agent: Firefox but the cookies are exported from Chrome, is this maybe an issue? I have tryed different methods and languages Python and perl.