https://github.com/sskender/delish-scraper
Scrape recipes from www.delish.com
https://github.com/sskender/delish-scraper
axios cookbook cooking delish mongodb mongoose nodejs recipe scrape scraper
Last synced: about 1 month ago
JSON representation
Scrape recipes from www.delish.com
- Host: GitHub
- URL: https://github.com/sskender/delish-scraper
- Owner: sskender
- License: mit
- Created: 2020-03-08T11:51:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T00:04:21.000Z (almost 3 years ago)
- Last Synced: 2025-01-26T20:26:12.833Z (over 1 year ago)
- Topics: axios, cookbook, cooking, delish, mongodb, mongoose, nodejs, recipe, scrape, scraper
- Language: JavaScript
- Size: 33.2 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# delish-scraper
Scrape recipes from www.delish.com
#### Scrape recipe from url and get JSON back:
```javascript
const scraper = require('./scraper');
// delish recipe url
const url = 'https://www.delish.com/cooking/recipe-ideas/recipes/a52422/brunch-punch-recipe/';
scraper.scrapeRecipe(url)
.then((recipe) => {
console.log(recipe);
}) ...
```
Response:
```javascript
{
originUrl: 'https://www.delish.com/cooking/recipe-ideas/recipes/a52422/brunch-punch-recipe/',
title: 'Brunch Punch',
image: 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/delish-191017-brunch-punch-0211-landscape-pf-1583527183.jpg',
servings: 25,
prepTime: { hours: 0, minutes: 10 },
ingredients: [
'ice',
'2 liter sprite',
'2 c.orange juice',
'2 c.pineapple juice',
'2 c.vodka',
'1 bottle prosecco',
'2 c.Strawberries, sliced',
'2 c.raspberries',
'1 c.Fresh mint leaves, plus more for garnish',
'Sanding sugars, for rims'
],
directions: [
'To a large punch bowl, add ice, Sprite, orange juice, pineapple juice, vodka, Prosecco, strawberries, raspberries and mint leaves and stir to combine.',
'In a small dish of sanding sugar, rim glasses with fresh strawberry and coat rims with sugar. Ladle punch into glasses and garnish with more mint.'
]
}
```
#### Scrape recipe from url and get Mongo schema back:
```javascript
const scraper = require('./scraper');
// delish recipe url
const url = 'https://www.delish.com/cooking/recipe-ideas/recipes/a52422/brunch-punch-recipe/';
scraper.scrapeRecipeModel(url)
.then((recipe) => {
recipe.save((err, recipe) => {
...
});
}) ...
```
Response:
```javascript
{
ingredients: [
'ice',
'2 liter sprite',
'2 c.orange juice',
'2 c.pineapple juice',
'2 c.vodka',
'1 bottle prosecco',
'2 c.Strawberries, sliced',
'2 c.raspberries',
'1 c.Fresh mint leaves, plus more for garnish',
'Sanding sugars, for rims'
],
directions: [
'To a large punch bowl, add ice, Sprite, orange juice, pineapple juice, vodka, Prosecco, strawberries, raspberries and mint leaves and stir to combine.',
'In a small dish of sanding sugar, rim glasses with fresh strawberry and coat rims with sugar. Ladle punch into glasses and garnish with more mint.'
],
_id: 5e679889f09efe0b71c70dc7,
originUrl: 'https://www.delish.com/cooking/recipe-ideas/recipes/a52422/brunch-punch-recipe/',
title: 'Brunch Punch',
image: 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/delish-191017-brunch-punch-0211-landscape-pf-1583527183.jpg',
servings: 25,
prepTime: { hours: 0, minutes: 10 },
created: 2020-03-10T13:39:21.599Z
}
```