sratter

0.0.0 • Public • Published

sratter

the worts scrapper for the peruvian congress website

Development

  1. Install dependencies using
npm install
  1. Create a .env file with the following variables
CONGRESS_URL_BASE=http://www.congreso.gob.pe/
CONGRESS_URL_LIST=congresistas

Usage

  1. Get all the information of the last period of the congress
const srapper = require('srapper');
srapper
  .listAll()
  .then((people) => {
    //do something with the information here
  });
  1. Get information from other period rather than the last one
const srapper = require('srapper');
srapper
  .listAll(6) // six means the period 2011 - 2016
  .then((people) => {
    //do something with the information here
  });

Data Structure

  1. The listAll method will return you an array of objects
[
  {
    id: 1, // an arbitrary index
    email: 'racuna@congreso.gob.pe',
    fullName: 'Acuña Núñez Richard Frank',
    image: 'http://www.congreso.gob.pe/Storage/tbl_congresistas/fld_47_Fotografia_file/802-o5Bb5Jd3Ns0Gr4I.jpg',
    party: 'ALIANZA PARA EL PROGRESO',
  },
]

I do not care about your silly package, give me the data

  1. Ok ok, slow down little man, here you have the list of the last period
http://www.jsoneditoronline.org/?id=206b733c480dde6801707e1224022fad

Readme

Keywords

none

Package Sidebar

Install

npm i sratter

Weekly Downloads

2

Version

0.0.0

License

MIT

Last publish

Collaborators

  • erivero