diff --git a/composer.json b/composer.json index c43e857..fb72abb 100644 --- a/composer.json +++ b/composer.json @@ -9,8 +9,8 @@ "require": { "php": ">=5.3.2", "kriswallsmith/buzz": "0.7", - "symfony/console": "2.1.*", - "symfony/dom-crawler": "2.1.*", - "symfony/css-selector": "2.1.*" + "symfony/console": "2.3.*", + "symfony/dom-crawler": "2.3.*", + "symfony/css-selector": "2.3.*" } } diff --git a/src/IMDb/Movie.php b/src/IMDb/Movie.php index 6ac3e6a..6aee6ae 100644 --- a/src/IMDb/Movie.php +++ b/src/IMDb/Movie.php @@ -62,8 +62,8 @@ public function getDirectors() try { $this->getCrawler()->filterXpath("//div[@id='director-info']/div/a")->each(function ($node, $i) use (&$directors) { - preg_match('/\d+/', $node->getAttribute('href'), $matches); - $directors[$matches[0]] = $node->nodeValue; + preg_match('/\d+/', $node->attr('href'), $matches); + $directors[$matches[0]] = $node->text(); }); } catch (\Exception $e) { } @@ -77,8 +77,8 @@ public function getCastMembers() try { $this->getCrawler()->filter("table.cast td.nm a")->each(function ($node, $i) use (&$members) { - preg_match('/\d+/', $node->getAttribute('href'), $matches); - $members[$matches[0]] = $node->nodeValue; + preg_match('/\d+/', $node->attr('href'), $matches); + $members[$matches[0]] = $node->text(); }); } catch (\Exception $e) { } @@ -92,7 +92,7 @@ public function getCastCharacters() try { $this->getCrawler()->filter("table.cast td.char")->each(function ($node, $i) use (&$characters) { - $characters[] = $node->nodeValue; + $characters[] = $node->text(); }); } catch (\Exception $e) { } @@ -125,7 +125,7 @@ public function getGenres() try { $this->getCrawler()->filterXpath("//div[@class='info-content']/a[contains(@href, '/Sections/Genres')]")->each(function ($node, $i) use (&$genres) { - $genres[] = $node->nodeValue; + $genres[] = $node->text(); }); } catch (\Exception $e) { } @@ -139,7 +139,7 @@ public function getLanguages() try { $this->getCrawler()->filterXpath("//a[contains(@href, '/language')]")->each(function ($node, $i) use (&$languages) { - $languages[] = $node->nodeValue; + $languages[] = $node->text(); }); } catch (\Exception $e) { @@ -154,7 +154,7 @@ public function getCountries() try { $this->getCrawler()->filterXpath("//div[@class='info-content']/a[contains(@href, '/country/')]")->each(function ($node, $i) use (&$countries) { - $countries[] = $node->nodeValue; + $countries[] = $node->text(); }); } catch (\Exception $e) { diff --git a/src/IMDb/MovieList.php b/src/IMDb/MovieList.php index 471776f..3222bbd 100644 --- a/src/IMDb/MovieList.php +++ b/src/IMDb/MovieList.php @@ -17,9 +17,9 @@ protected function parseMovies() $movies = $ids = array(); $this->getCrawler()->filterXpath("//a[contains(@href, '/title/tt')]")->each(function ($node, $i) use(&$ids) { - preg_match('/\d+/', $node->getAttribute('href'), $matches); + preg_match('/\d+/', $node->attr('href'), $matches); - $title = $node->nodeValue; + $title = $node->text(); $ids[$matches[0]] = $title; });