You are here

protected function FeedsCrawler::parseXPath in Feeds Crawler 7

Same name and namespace in other branches
  1. 6.2 FeedsCrawler.inc \FeedsCrawler::parseXPath()

Finds the "next" link on a page via XPath.

1 call to FeedsCrawler::parseXPath()
FeedsCrawler::fetch in ./FeedsCrawler.inc
Implements FeedsFetcher::fetch().

File

./FeedsCrawler.inc, line 95
Home of the FeedsCrawler.

Class

FeedsCrawler
Fetches data via HTTP.

Code

protected function parseXPath($result, $source_config) {
  $errors = $this
    ->errorStart();
  $dom = new DOMDocument();
  $dom
    ->loadHTML($result
    ->getRaw());
  $xml = simplexml_import_dom($dom);
  unset($dom);
  $href = $xml
    ->xpath($source_config['crawler']['xpath']);
  unset($xml);
  $this
    ->errorStop($errors, FALSE);
  return $this
    ->parseHref($href, $source_config['source']);
}