/**
  * @param ImportCategory $category
  * @return int
  */
 protected function getCategoryProductsCount($category)
 {
     /** @var \simple_html_dom $html */
     $html = $this->getHtmlDocument($category->getUrl() . (strpos($category->getUrl(), 'List?') ? '&' : '?') . 'Page=0&PageSize=1');
     $matches = array();
     return preg_match('/(?<=Page=)\\d+/', $html->findOne('div.paging span.last a')->attr['href'], $matches) ? $matches[0] + 1 : null;
 }
 /**
  * @param ImportCategory $category
  * @throws \Exception
  * @return int
  */
 protected function getCategoryProductsCount($category)
 {
     list($address, $query) = explode('?', $category->getUrl());
     $html = $this->getPage($address, null, "{$query}&page=1&pageSize=40", array("Content-Type" => "application/x-www-form-urlencoded; charset=UTF-8"));
     $json = json_decode($html);
     if (isset($json->totalCount)) {
         return $json->totalCount;
     } else {
         throw new \Exception("No product count is defined");
     }
 }
 /**
  * @param ImportCategory $category
  * @return int
  */
 protected function getCategoryProductsCount($category)
 {
     $html = $this->getHtmlDocument($category->getUrl());
     $matches = [];
     if (preg_match('/\\d+/', $html->findOne('p.prdCount')->text(), $matches)) {
         return $matches[0];
     } else {
         return null;
     }
 }