/**
  * @param Crawler $resultItemDiv
  * @param $paramName
  * @param $className
  *
  * @return ResultItem|null
  */
 private function parseResultItem(Crawler $resultItemDiv, $paramName, $className)
 {
     $resultItemA = $resultItemDiv->filter('h2 a, .name a')->first();
     $url = $resultItemA->attr('href');
     if (!$url) {
         return null;
     }
     $resultItem = new ResultItem();
     $resultItem->setId(ParseHelper::getParamFromLink($url, $paramName));
     $resultItem->setName($resultItemA->text());
     $resultItem->setInfo(strip_tags($resultItemDiv->filter($className)->first()->text()));
     return $resultItem;
 }
 /**
  * Parses the content as Result Item (Generic).
  *
  * @param Crawler $resultItemDiv
  * @param string  $paramName
  * @param string  $className
  * @param string  $fallbackUrl
  *
  * @return ResultItem|null
  */
 private function parseResultItem(Crawler $resultItemDiv, $paramName, $className, $fallbackUrl = null)
 {
     $filter = 'h2[itemprop=name] a, h2[itemprop=name], .name a';
     $resultItemA = $resultItemDiv->filter($filter)->first();
     if ($resultItemA->count() > 0) {
         if ($resultItemA->nodeName() == "a") {
             $url = $resultItemA->attr('href');
         } elseif ($resultItemA->nodeName() == "h2" && $fallbackUrl != null) {
             $url = $fallbackUrl;
         }
     } else {
         throw new \Exception("Can't detect title of item!");
     }
     if (!$url) {
         return null;
     }
     $resultItem = new ResultItem();
     $resultItem->setId(ParseHelper::getParamFromLink($url, $paramName));
     $resultItem->setName($resultItemA->text());
     $resultItem->setInfo(strip_tags($resultItemDiv->filter($className)->first()->text()));
     return $resultItem;
 }