PHP curl function simulated crawler (operation cookie)

time:17-06-29 forum:PHP tools and code
  http://www.cnblogs.com/tohilary/archive... 79501.html

analog cookie brush paste; The IE content to the file cookie.txt
curl_setopt ($ch, CURLOPT_COOKIEJAR, "E:/cookie.txt");
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / curl_setopt / / / / / / / / / / / / / / / / CURLOPT_COOKIEJAR. T ($ch, CURLOPT_URL, "http://www.mynit.net/login.php");
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "); / / / / / / / / / / / / / / / / / / / lose The whole content goes to the browser
curl_close ($ch);
unset ($ch);
$ch = curl_init ();
curl_setopt ($ch, 1);
/ / / execution operation, for example, brush, if you want to brush, it will be recycled 1000 times, not enough.
$buf2 = curl_exec ($ch);
curl_close ($ch);
echo $buf2; / / / / / / >.Gt; Ttp://www.nbchem.com/user/login.php? User=yourname.amp; password=pwd.amp; act=1 ');
curl_setopt ($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($c, CURLOPT_COOKIEJAR,); =curl_init ($c);
curl_setopt ($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($c, CURLOPT_COOKIEFILE, $cookie_jar);
>!
  • 2

prev:Using CURL instead of file_get_contents ... next:PHP cURL to achieve simulation login and...
post comment
Notice



approved   Will the bonus be divided, which wil...   Before buying a house, buying a hous...   "Your advice really can't help me." ...   A rare picture of the old Ji'nan! Th...   The deep mountain women's back husba...
rand   Using Json to realize data exchange ...   PHP verification code landing check   Install.php simple production   Wan net interview PHP written test   PHP automatically identifies links i...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com