Git Product home page Git Product logo

scraping-inflation's Introduction

Scraping the Inflation

This package helps to measure inflation in Spain, scraping various supermarkets websites, using Puppeteer.

Also useful if you need data of thousands of products to practice or develop a personal project.

Websites scraped:

Getting Started

Installation

To use Scraping Inflation in your project, run:

npm i scraping-inflation

Example

const scraping = require("scraping-inflation");

scraping.mercadona(true, true, true, "28001").then((products) => {
    // Do something with products
});

(async function getCarrefourProducts() {
    let products = await scraping.carrefour(false, false, true);
    // Do something with products
})();

let diaProducts = scraping.dia(true, false, false);
diaProducts.then((products) => {
    // Do something with products
});

To run Chromium in headless mode, set first argument to true.

To save products in .json file, set second argument to true.

To save process log in a .txt file, set third argument to true, otherwise the progress of the scraping process will be printed in the STDOUT (console).

Result JSONs

The result of the scraping process is an array of JSON of all the products of the website.

The JSONs properties are:

{
    description: // { string } Product name and format
    source: // { string } "mercadona" || "carrefour" || "dia"
    image: // { string } Image URL
    url: // { string } Product details URL (if any)
    category: // { string } Product category
    subcategory: // { string } Product subcategory
    class: // { string } Product class or third level category
    price: // { string } Price in € (includes € symbol)
    pricePerUnit: // { string } Price per kilogram or litre (if any)
}

scraping-inflation's People

Contributors

nachosdt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.