I want to create a crawler that receives information about all pages one by one from number 0 to 10,000,000. It doesn't matter how long it takes. I just want it to work. Here is the error I get
Fatal error: Maximum function nesting level of '100' reached, aborting! in D: \ wamp \ www \ crawler \ index.php on line 25
Line 25 is equal
$htmlstr = (string)$this->curlGet($url);
And there is my full script.
Thank you for your help!
header('Content-Type: text/html; charset=utf-8'); ini_set('max_input_nesting_level','100000'); ini_set('max_execution_time','100000'); class crawler{ private $url; private $page; private $bothurl; private $innerDom = null; public $prop; public $entry; function __construct($entry){ $this->entry = $entry; $this->bothurl = array('http://www.remax-quebec.com/fr/inscription/Q/'.$entry.'.rmx','http://www.remax-quebec.com/en/inscription/Q/'.$entry.'.rmx'); $this->scan(); } private function scan(){ $i =0; foreach($this->bothurl as $url){ $this->url = $url; $this->lang = ($i==0)?'fr':'en'; $htmlstr = (string)$this->curlGet($url); $dom = new DOMDocument; @$dom->loadHTML($htmlstr); $this->page = $dom; $this->htmlInfos(); $this->getInfos(); $i++; } } private function htmlInfos(){ $divs = $this->page->getElementsByTagName('div'); foreach($divs as $div){ if($div->hasAttribute('class') && $div->getAttribute('class') == 'bloc specs'){ $innerDom = new DOMDocument(); @$innerDom->loadHTML($this->innerHTML($div)); $this->innerDom = $innerDom; } } if($this->innerDom === null) $this->changeEntry(); } private function getInfos(){ $sect = 0; foreach($this->innerDom->getElementsByTagName('div') as $div){
php xdebug
Mike boutin
source share