Numerous Pulls Merged

    @sirodiaz/metascraper-universal-shopping

    1.5.0 • Public • Published

    metascraper-shopping

    npm Dependency Status

    A custom rule bundle for @microlinkhq/metascraper to get product information from HTML markup on merchant websites

    Install

    $ npm install @sirodiaz/metascraper-universal-shopping --save

    Usage

    'use strict'
    
    const metascraper = require('metascraper')([
      require('@sirodiaz/metascraper-universal-shopping')(),
      require('metascraper-title')(),
      require('metascraper-image')(),
      require('metascraper-url')()
    ]);
    const got = require('got');
    
    const goShopping = async () => {
      const targetUrl = '<an URL from any e-commerce website>';
      const { body: html, url } = await got(targetUrl);
      const metadata = await metascraper({ html, url });
      console.log(metadata);
    };
    
    goShopping();
    
    /*
    metadata: {
      title:        [String]
      image:        [String]
      url:          [String]
      price:        [Float]
      currency:     [String]
      condition:    [String]
      sku:          [String]
      mpn:          [String]
      availability: [String]
      asin:         [String]
    }
    */

    License

    @SiroDiaz/metascraper-universal-shopping © 2022 Siro Díaz, Released under the MIT License. @sami/metascraper-shopping © 2019 Samir Rayani, Released under the MIT License.

    Install

    npm i @sirodiaz/metascraper-universal-shopping

    DownloadsWeekly Downloads

    0

    Version

    1.5.0

    License

    MIT

    Unpacked Size

    5.81 MB

    Total Files

    21

    Last publish

    Collaborators

    • sirodiaz