@neytrino-kain

Как избавиться от ошибки в строке?

PHP Fatal error: Call to a member function find() on boolean in on line 24
Вот строка:
$date = $content_dom->find('.date', 0);

Вот весь код простенького парсера:
<meta charset="utf-8">
<?php
	/*
		Парсер фильмов
	*/

	include_once('lib/SQL.php');
	include_once('lib/curl_query.php');
	include_once('lib/simple_html_dom.php');

/*	$sql = SQL::Instance();*/
	
	$html = curl_get('http://САЙТ');
	$dom = str_get_html($html);
	
	$courses = $dom->find('.content-container');
	
	foreach($courses as $course) {
		$a = $course->find('a', 0);
		
		$content = curl_get('http://САЙТ' . $a->href);
		$content_dom = str_get_html($content);
		
		$date = $content_dom->find('.date', 0);
		echo $a->plaintext . ' ' . $date->plaintext;
		
		break;
			
			
	}
  • Вопрос задан
  • 125 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы