How to capture website cookies saved in browser?

Asked

Viewed 82 times

0

Hi, guys. How do I capture cookies from a website and pass to Curl? I am using the extension "cookie editor" to see the cookies and passing to a txt file to run on Curl, but I can’t see the page I wish, someone could help?

"because vc does not try to login through Curl?"

I’ve tried but I think they use some Javascript function that prevents login with Curl.

     libxml_use_internal_errors(true) and libxml_clear_errors();
     $header = "X-Forwarded-For: {$_SERVER['REMOTE_ADDR']}";

     $url_login = "https://extra.bet365.com/results";

     $chl = curl_init();
     curl_setopt($chl, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($chl, CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookies.txt');
     curl_setopt($chl, CURLOPT_URL, $url_login);
     curl_setopt($chl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
     curl_setopt($chl, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($chl, CURLOPT_HEADER, 1);
     curl_setopt($chl, CURLOPT_VERBOSE, 1);
     curl_setopt($chl, CURLOPT_CONNECTTIMEOUT, 120);
     curl_setopt($chl, CURLOPT_TIMEOUT, 120);
     curl_setopt($chl, CURLOPT_FOLLOWLOCATION, true);
     curl_setopt($chl, CURLOPT_ENCODING, "");
     $error = curl_error($chl);
     $dado = curl_exec($chl); 
     curl_close ($chl);


      echo $dado;       
  • Will count cards?

  • It is not possible for you to pick up cookies from a website that has different domain than your own... For example if the cookie is from the site bet365.com only this url can read the cookies that it left.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.