protected function applyScraperConfig()
 {
     parent::applyScraperConfig();
     $this->config['image']['selector'] = '.recipePartRecipeImage img';
     $this->config['recipeIngredients']['selector'] = '.recipePartIngredientGroup h2, .recipePartIngredientGroup dl';
     $this->config['url']['selector'] = '[rel="canonical"]';
 }
 protected function applyScraperConfig()
 {
     parent::applyScraperConfig();
     $this->config['image']['locations'] = ['data-lazy-src'];
     $this->config['image']['selector'] = '.main-image img[class*="wp-"]';
     $this->config['recipeIngredients']['formatter'] = MultiFromChildren::class;
     $this->config['recipeIngredients']['selector'] = '[itemprop="ingredients"], .ingredients dt';
     $this->config['recipeInstructions']['formatter'] = MultiFromChildren::class;
     $this->config['recipeInstructions']['selector'] = '[itemprop="recipeInstructions"] li, [itemprop="recipeInstructions"] strong, [itemprop="recipeInstructions"] h4';
     $this->config['url']['selector'] = '[rel="canonical"]';
 }
 protected function applyScraperConfig()
 {
     parent::applyScraperConfig();
     $this->config['description']['selector'] = '[property="og:description"]';
     $this->config['description']['normalizers'][] = Description::class;
     $this->config['image']['selector'] = '.blog p:first-child img';
     $this->config['recipeCategories']['locations'] = ['_text'];
     $this->config['recipeCategories']['selector'] = '.category-link-single';
     $this->config['recipeIngredients']['formatter'] = MultiFromChildren::class;
     $this->config['recipeInstructions']['selector'] = '[itemprop="recipeInstructions"] p';
     $this->config['url']['selector'] = '[rel="canonical"]';
 }
Esempio n. 4
0
 protected function applyScraperConfig()
 {
     parent::applyScraperConfig();
     $this->config['author']['selector'] = '[itemprop="author"] [itemprop="name"]';
     // Having trouble getting name, I think because it is in a <p> within a <h1> which is not valid.
     $this->config['name']['selector'] = '[property="og:title"]';
     $this->config['name']['normalizers'][] = Name::class;
     $this->config['publisher']['selector'] = '.field-sponsor';
     $this->config['recipeInstructions']['selector'] = '[itemprop="recipeInstructions"] p';
     $this->config['totalTime']['selector'] = '.recipe-totaltime-duration';
     $this->config['url']['selector'] = '[rel="canonical"]';
 }
 protected function applyScraperConfig()
 {
     parent::applyScraperConfig();
     // Get first image in .entry-content.
     $this->config['image']['selector'] = '.entry-content img:first-child';
     $this->config['recipeIngredients']['selector'] = '[itemprop="ingredients"]';
     $this->config['recipeInstructions']['selector'] = '[itemprop="recipeInstructions"]';
     $this->config['url']['selector'] = '[rel="canonical"]';
     $pos = array_search(SingleLine::class, $this->config['recipeInstructions']['normalizers']);
     unset($this->config['recipeInstructions']['normalizers'][$pos]);
     $this->config['recipeInstructions']['normalizers'][] = SplitOnEOL::class;
 }
 protected function applyScraperConfig()
 {
     parent::applyScraperConfig();
     // Description at default location is for brand, not recipe.
     $this->config['description']['selector'] = '.fake-selector';
     $this->config['image']['selector'] = '.photo';
     $this->config['recipeIngredients']['selector'] = '[itemprop="ingredients"] li, [itemprop="ingredients"] span';
     $this->config['url']['selector'] = '[rel="canonical"]';
     $pos = array_search(SingleLine::class, $this->config['recipeInstructions']['normalizers']);
     unset($this->config['recipeInstructions']['normalizers'][$pos]);
     $this->config['recipeInstructions']['normalizers'][] = SplitOnEOL::class;
 }
 protected function applyScraperConfig()
 {
     parent::applyScraperConfig();
     $this->config['author']['selector'] = '[itemprop="author"] [itemprop="name"]';
     $this->config['description']['selector'] = '[itemprop="description"] + p';
     $this->config['name']['selector'] = 'h1[itemprop="name"]';
     $this->config['recipeCategories']['selector'] = '.tags_names';
     $this->config['recipeCategories']['normalizers'][] = SplitOnComma::class;
     $this->config['recipeIngredients']['selector'] = '[itemprop="ingredients"], .ingredients-list__title';
     $this->config['recipeInstructions']['selector'] = '[itemprop="recipeInstructions"] li';
     $this->config['url']['selector'] = '[rel="canonical"]';
 }