bencooling / wikitable

HTML table scraper for wikipedia or any other site.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Coverage Status

wikitable

HTML table scraper for wikipedia or any other site.

0.2.3 API Reference

wikitable(options)

Scrape tables from wikipedia or any webpage, returning in a nested array or object (default) format.

  • options
    • url - Required url of the webpage to scrape
    • selector - Optional css selector, defaults to .wikitable
    • format - Optional format either object or array.
// usage:
const url = 'https://en.wikipedia.org/wiki/List_of_modern_names_for_biblical_place_names';
wikitable({ url, format: 'array' })
  .then(data => console.log(data));
/*
  data:
  [ [ [ 'Biblical name', 'Mentioned in', 'Present name', ... ],
      [ 'Adramyttium', 'Acts 27:2', 'Burhaniye', ... ],
  ...
  ] ]
*/

About

HTML table scraper for wikipedia or any other site.


Languages

Language:JavaScript 100.0%