I use a foreach loop to loop through multiple seed urls. During each loop, I instantiate a crawler using PHPCrawl and the next seed url.
foreach($companyUrls as $companyId => $companyUrl) {
$crawler = new MyCrawler($companyUrl, $companyId);
$crawler->go();
}
It runs fine for the first loop, but throws the following error the second time through before any crawling has been done:
"Call to undefined method stdClass::receivePage() in
/data/utilities/PHPCrawl_070/classes/phpcrawler.class.php on line 201"
I have not modified the original PHPCrawl V0.70 classes in any way. I have only extended the PHPCrawler class and added process code to the handlePageData() function as described in the PHPCrawl documentation. If I run this without the foreach loop (instantiating a new class one at a time with new urls), the system works fine.
Ple开发者_StackOverflowase help!!
This is a known error and has been fixed in Version 0.71 (I was using version 0.70).
Thanks @prodigitalson for your comment.
精彩评论