All Projects → jadkins89 → Recipe-Scraper

jadkins89 / Recipe-Scraper

Licence: MIT license
A JS package for scraping recipes from the web.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Recipe-Scraper

trawler
scraper for facebook, gab, google and tiktok
Stars: ✭ 20 (-74.36%)
Mutual labels:  scraper
ant
A web crawler for Go
Stars: ✭ 264 (+238.46%)
Mutual labels:  scraper
saveddit
Bulk Downloader for Reddit
Stars: ✭ 130 (+66.67%)
Mutual labels:  scraper
pinterest-web-scraper
Scraping Visually Similar Images from Pinterest
Stars: ✭ 26 (-66.67%)
Mutual labels:  scraper
pyitau
Unofficial client to access your Itaú bank data
Stars: ✭ 28 (-64.1%)
Mutual labels:  scraper
extract-emails
Extract emails from a given website
Stars: ✭ 58 (-25.64%)
Mutual labels:  scraper
PTTmineR
Parallel Searching and Crawling Data from PTT 🚀
Stars: ✭ 31 (-60.26%)
Mutual labels:  scraper
vsco-scraper
Easily allows for scraping a VSCO
Stars: ✭ 106 (+35.9%)
Mutual labels:  scraper
scrapeer
Essential PHP library that scrapes HTTP(S) and UDP trackers for torrent information.
Stars: ✭ 81 (+3.85%)
Mutual labels:  scraper
avbot-charts
Aviation charts
Stars: ✭ 20 (-74.36%)
Mutual labels:  scraper
gHarvester
Proof of concept for a security issue (in my opinion) that I found in accounts.google.com
Stars: ✭ 20 (-74.36%)
Mutual labels:  scraper
rose
Analyse all kinds of data for a TV series
Stars: ✭ 34 (-56.41%)
Mutual labels:  scraper
blinkist-m4a-downloader
Grabs all of the audio files from all of the Blinkist books
Stars: ✭ 100 (+28.21%)
Mutual labels:  scraper
Federal-Parliament-Scraper
A scraper for obtaining information on the workings of the Belgian Federal Parliament.
Stars: ✭ 18 (-76.92%)
Mutual labels:  scraper
website-to-json
Converts website to json using jQuery selectors
Stars: ✭ 37 (-52.56%)
Mutual labels:  scraper
python web scraping
Web scraping using python, requests and selenium
Stars: ✭ 40 (-48.72%)
Mutual labels:  scraper
diffbot-php-client
[Deprecated - Maintenance mode - use APIs directly please!] The official Diffbot client library
Stars: ✭ 53 (-32.05%)
Mutual labels:  scraper
extension
web scraping extension
Stars: ✭ 28 (-64.1%)
Mutual labels:  scraper
scraper
图片爬取下载工具,极速爬取下载 站酷https://www.zcool.com.cn/, CNU 视觉 http://www.cnu.cc/ 设计师/用户 上传的 图片/照片/插画。
Stars: ✭ 64 (-17.95%)
Mutual labels:  scraper
GChan
Scrape boards and threads from 4chan (8kun WIP). Downloads images, videos and HTML if desired.
Stars: ✭ 31 (-60.26%)
Mutual labels:  scraper

recipe-scraper

A NodeJS package for scraping recipes from the web.

Build Status Coverage Status

Installation

npm install recipe-scraper

Usage

// 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
  });

Supported Websites

Don't see a website you'd like to scrape? Open an issue and we'll do our best to add it.

Recipe Object

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: ""
    }
}

Error Handling

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'"
});

Bugs

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.

Contributing

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 😁

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].