Просмотр исходного кода

Add missing data from HCA scraping config. TG-13

Tati 7 лет назад
Родитель
Сommit
e406083401
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      ktchn/src/recipes/scrape/sources/home-cooking-adventure.ts

+ 4 - 0
ktchn/src/recipes/scrape/sources/home-cooking-adventure.ts

@@ -9,6 +9,7 @@ const SELECTORS = {
   SERVINGS: 'span.ingheading',
   SERVINGS: 'span.ingheading',
   INGREDIENTS: 'div#ingredients_bg ul li',
   INGREDIENTS: 'div#ingredients_bg ul li',
   INSTRUCTIONS: 'div#preparation ol li',
   INSTRUCTIONS: 'div#preparation ol li',
+  SUMMARY: 'span[itemprop="summary"]'
 }
 }
 
 
 function getRecipeName($: CheerioSelector): string {
 function getRecipeName($: CheerioSelector): string {
@@ -64,6 +65,9 @@ const HCA_CONFIG = {
     getRecipeDetails($),
     getRecipeDetails($),
     getIngredients($),
     getIngredients($),
     getInstructions($),
     getInstructions($),
+    [],
+    [],
+    $(SELECTORS.SUMMARY).children().first().text().trim(),  
   )
   )
 }
 }