Code
$httpClass = new Snoopy();
$httpClass->fetch('https://v.qq.com/');
$url = $httpClass->results;
print_r($url);die();
Crawling https://www.baidu.com/ keeps reporting 405 errors
Crawling https://v.qq.com/ is running normally
Looking for an answer, I’ve been working on it all afternoon and still can’t solve it
擁有18年軟件開(kāi)發(fā)和IT教學(xué)經(jīng)驗(yàn)。曾任多家上市公司技術(shù)總監(jiān)、架構(gòu)師、項(xiàng)目經(jīng)理、高級(jí)軟件工程師等職務(wù)。 網(wǎng)絡(luò)人氣名人講師,...
Baidu probably has a crawler-like setting. You need to disguise it and define a UA or something like that
Reference: http://www.4wei.cn/archives/396
This is not a Snoopy-type problem. It's because you don't know much about crawlers. Since there are crawlers, of course there will be anti-crawler technology. The simplest is based on the browser identifier or the referer in the request header, etc. Big websites like Baidu and Tencent will not want us to crawl data, so they must have taken many preventive measures. Therefore, it is recommended to understand the knowledge of crawlers before crawling data.