Symfony\Component\DomCrawler\Crawler::selectLink PHP Method

    public function selectLink($value)
    {
        $xpath = sprintf('descendant-or-self::a[contains(concat(\' \', normalize-space(string(.)), \' \'), %s) ', static::xpathLiteral(' ' . $value . ' ')) . sprintf('or ./img[contains(concat(\' \', normalize-space(string(@alt)), \' \'), %s)]]', static::xpathLiteral(' ' . $value . ' '));
        return $this->filterRelativeXPath($xpath);
    }

Usage Example

コード例 #1
0
 /**
  * Gets the details page.
  *
  * @return Crawler
  * @todo Refactor this as it is not possible to mock currently
  */
 private function getDetails()
 {
     if (is_null($this->details)) {
         $url = $this->crawler->selectLink($this->getTitle())->link()->getUri();
         $scraper = new Scraper();
         $this->details = $scraper->fetch($url);
         $this->length = $scraper->getResponseSize();
     }
     return $this->details;
 }
All Usage Examples Of Symfony\Component\DomCrawler\Crawler::selectLink