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   These 3 kinds of fathers are easy to...   Do nuclear reactors learn calculus? ...   Wearing 35 yuan clothes and feeding ...   The age of mortgage repayment is rai...   What do you do with a baby crying ou...
rand   Use.Htaccess to prevent images from ...   Encryption and decryption of PHP fil...   PHP hidden data, MD5 encryption, int...   Processing method of Chinese charact...   The solution of reading TXT Chinese ...
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