This project is a parser for the data in the navbox section at the bottom of Wikipedia pages.
This data is great for gathering lists of data on specific topics.
const { NavboxParser } = require('@etomon/wiki-nav-parser');
(async () => {
let parser = await NavboxParser.fromUrl(`https://en.wikipedia.org/wiki/President_of_the_United_States`);
let collections = parser.getCollections();
console.log(JSON.stringify(Array.from(collections.entries()), null, 2));
})();
[
[
"Presidents of the United States",
{
"title": "Presidents of the United States",
"lists": [
{
"title": "Presidents of the United States",
"listItems": [
{
"links": [
{
"index": 0,
"title": "George Washington",
"url": "https://en.wikipedia.org/wiki/George_Washington"
},
{
"index": 0,
"title": "1789–1797",
"url": "https://en.wikipedia.org/wiki/Presidency_of_George_Washington"
}
]
},
...
An image of the data structure mapped onto an actual Wikipedia page is included below.

@etomon/wiki-navbox-parser is written in TypeScript, to build run npm run build.
Documentation can be found here.
Tests are written in Mocha. Run npm test to test.
Wiki Navbox Parser is licensed under the ISC License, a copy of which can be found at https://opensource.org/licenses/ISC.
Generated using TypeDoc