开发者

Instantiating a new PHPCrawl Class throws the error "Call to undefined method stdClass::receivePage()"

开发者 https://www.devze.com 2023-03-17 19:27 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号