我使用foreach循环遍历多个种子urls。在每个循环中,我使用PHPCrawl和下一个种子url实例化了一个爬虫。
foreach($companyUrls as $companyId => $companyUrl) {
$crawler = new MyCrawler($companyUrl, $companyId);
$crawler->go();
}它在第一次循环中运行得很好,但在爬行之前第二次抛出了以下错误:
"Call to undefined method stdClass::receivePage() in
/data/utilities/PHPCrawl_070/classes/phpcrawler.class.php on line 201"我没有以任何方式修改原始的PHPCrawl V0.70类。我只扩展了PHPCrawler类,并向handlePageData()函数添加了进程代码,如PHPCrawl文档中所述。如果我不使用foreach循环(用新的urls一次实例化一个新的类)来运行它,系统会工作得很好。
请帮帮我!!
发布于 2011-07-06 14:55:11
这是一个已知的错误和has been fixed in Version 0.71 (我使用的是版本0.70)。
感谢@prodigitalson的评论。
https://stackoverflow.com/questions/6592314
复制相似问题