If the url link is https://mbd.baidu.com/newspage/data/landingsuper?context={"nid":"news_4480296238548479181"}&n_type=0&p_from=1
How to crawl web page information
ringa_lee2017-12-07 14:20:17
Yes, what was said on the first floor is very complete. These two methods are usually used to obtain page information, file_get_contents and curl request
NULL2017-12-07 13:23:13
You can use file_get_contents or curl code:
function getHTTPS($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $result = curl_exec($ch); curl_close($ch); return $result; }