
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
recipe-scraper
Advanced tools
A NodeJS package for scraping recipes from the web.
npm install recipe-scraper
// import the module
const recipeScraper = require("recipe-scraper");
// enter a supported recipe url as a parameter - returns a promise
async function someAsyncFunc() {
...
let recipe = await recipeScraper("some.recipe.url");
...
}
// using Promise chaining
recipeScraper("some.recipe.url").then(recipe => {
// do something with recipe
}).catch(error => {
// do something with error
});
Don't see a website you'd like to scrape? Open an issue and we'll do our best to add it.
Depending on the recipe, certain fields may be left blank. All fields are represented as strings or arrays of strings. The name, ingredients, and instructions properties are required for schema validation.
{
name: "",
ingredients: [],
instructions: [],
tags: [],
servings: "",
image: "",
time: {
prep: "",
cook: "",
active: "",
inactive: "",
ready: "",
total: ""
}
}
If the url provided is invalid and a domain is unable to be parsed, an error message will be returned.
recipeScraper("keyboard kitty").catch(error => {
console.log(error.message);
// => "Failed to parse domain"
});
If the url provided doesn't match a supported domain, an error message will be returned.
recipeScraper("some.invalid.url").catch(error => {
console.log(error.message);
// => "Site not yet supported"
});
If a recipe is not found on a supported domain site, an error message will be returned.
recipeScraper("some.no.recipe.url").catch(error => {
console.log(error.message);
// => "No recipe found on page"
});
If a page does not exist or some other 400+ error occurs when fetching, an error message will be returned.
recipeScraper("some.nonexistent.page").catch(error => {
console.log(error.message);
// => "No recipe found on page"
});
If a supported url does not contain the proper sub-url to be a valid recipe, an error message will be returned including the sub-url required.
recipeScraper("some.improper.url").catch(error => {
console.log(error.message);
// => "url provided must include '#subUrl'"
});
With web scraping comes a reliance on the website being used not changing format. If this occurs we need to update our scrape. Please reach out if you are experiencing an issue.
I welcome pull requests that keep the scrapes up to date or add new ones. I'm doing my best to keep this package maintained and with your help this goal is much more achievable. Please add testing if you add a scrape. Thank you 😁
FAQs
A JS package for scraping recipes from the web.
The npm package recipe-scraper receives a total of 105 weekly downloads. As such, recipe-scraper popularity was classified as not popular.
We found that recipe-scraper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.