While the following function was running, I got an exception, after which I got this error:
Error sending packet INIT_DB. PID = 7060
And then the script gave some warnings:
mysql_fetch_row () expects parameter 1 to be a resource
FUNCTION:
private function initiateChildCrawler($parent_Url_Html) { global $CFG; static $foundLink; static $parentID; static $urlToCrawl_InstanceOfChildren; $foundLinkArray = array(); $tempHtml = $parent_Url_Html->getHTML(); $foundLinkCount = 0; foreach($tempHtml->find('a') as $foundLinkArray[$foundLinkCount++]); $anotherArray = array(); $x = 0; for($i = 0; $i<$foundLinkCount; $i++) { $anotherArray[$x++] = $foundLinkArray[$i]->href; } foreach($anotherArray as $foundLink) { $foundLink = url_to_absolute($parent_Url_Html->getURL(), $foundLink); if($this->validateEduDomain($foundLink)) { $parentID = $this->loadSaveInstance->parentExists_In_URL_DB_CRAWL($this->returnParentDomain($foundLink)); if($parentID != FALSE) { if($this->loadSaveInstance->checkUrlDuplication_In_URL_DB_CRAWL($foundLink) == FALSE) { $urlToCrawl_InstanceOfChildren = new urlToCrawl($foundLink); if($urlToCrawl_InstanceOfChildren->getSimpleDomSource($CFG->finalContext)!= FALSE) { try { $this->loadSaveInstance->url_db_html($urlToCrawl_InstanceOfChildren->getURL(), $urlToCrawl_InstanceOfChildren->getHTML()); $this->loadSaveInstance->saveCrawled_To_URL_DB_CRAWL(NULL, $foundLink, "crawled", $parentID); } catch (DbException $e) { echo "<br><br>Exception Catched on line 303!!!<br><br>"; echo "The link where the exception was thrown was: {$foundLink}<br>"; if(strstr($e->getMessage(), 'MySQL server has gone away')) { $this->connection = mysql_connect("localhost", "root", ""); mysql_select_db("crawler1", $this->connection); } } } } } } } }
Specific Exception URL: http://www.ashford.edu/student_services/deanslist.htm
I donβt know about that. Please, help.
source share