Skip to content

nrodriguez/mercari-parser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mercari Parser

This simple library parses DOM Document objects of Mercari pages in to machine friendly JSON output. It is mainly intended to be ran in the browser right on the page itself but could also be used in node by using something like jsdom.

Setup

npm install git+https://github.com/louistio/mercari-parser.git --save

Usage

Assuming you have access to a compliant Document object of a Mercari item page, this is how you use it:

import { MercariItemParser } from 'mercari-parser';

const item = new MercariItemParser(document).parse();

Resulting item will look like:

{
  "version": "2",
  "id": "...",
  "title": "...",
  "description": "...",
  "price": "...",
  "shipping": "...",
  "date": "...",
  "imageUrl": "https://(...).jpg",
  "seller": {
    "userId": "...",
    "username": "...",
    "profile": "https://(...)/"
  }
}

About

Mercari HTML to JSON parser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%