您好,登錄后才能下訂單哦!
<?php
$url = 'http://www.zixue.it/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes';
// $data = 'fastloginfield=email&username=490433117%40qq.com&password=zx199084&quickforward=yes&handlekey=ls';
$data['fastloginfield'] = 'email';
$data['username'] = '490433117@qq.com';
$data['password'] = 'zx199084';
$data['quickforward'] = 'yes';
$data['handlekey'] = 'ls';
$cookie = 'D:\WWW\day1\curl\cookie.txt';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_exec($ch);
$last_url = 'http://www.zixue.it/thread-12785-1-1.html';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $last_url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie);
$content = curl_exec($curl);
$pattern = '/<dt>最后登錄<\/dt><dd>(?P<title>.*?)<\/dd>/is';
if(preg_match($pattern, $content, $matches)){
$title = $matches['title'];
var_dump($title);
echo 'comeOning';
}
要抓取登陸的頁面,,安裝正常登陸數據格式填寫
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。