@grodno-city/grodno-gov-renting-scraper
Scrap premises rented by Grodno government
Last updated 3 years ago by paloskin .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @grodno-city/grodno-gov-renting-scraper 
SYNC missed versions from official npm registry.

Scrap premises rented by Grodno government

Build Status

Scraper make requests to http://grodno.gov.by/ru/main.aspx?guid=7101

Install

yarn add @grodno-city/grodno-gov-renting-scraper

or

npm install --save @grodno-city/grodno-gov-renting-scraper

Usage

const { extract } = require('@grodno-city/grodno-gov-renting-scraper')

const run = async () => {
  const result = await extract()
  console.log(result)
}

run()

Provided result has "premises by organization" format, so it will something like:

[
  {
    name: 'Унитарное жилищное ремонтно-эксплуатационное предприятие Ленинского района',
    premises: [
      ...
      {
        address: 'ул. Академическая, 14',
        description: 'Нежилое изолированное помещение, на 1,2 этаже здания.',
        areas: '50,82; 39.0; 34.86;30.1; 14.4',
        appointment: 'офис, оказание услуг',
        contact: '43-04-47'
      }
      ...
    ]
  }
]

Enhancers

Enhancers can transform specific fields to machine-readable format

areaEnhancer

Transfrom areas field to array of numbers or objects

const { extract, enhancers } = require('@grodno-city/grodno-gov-renting-scraper')
const { areaEnhancer } = enhancers

const run = async () => {
  const result = await extract()
  result.forEach(organization => {
    organization.premises.forEach(premise => {
      const enhancedAddress = areaEnhancer(premise.areas)
      console.log(enhancedAddress)
    })
  })
}

run()

Areas array can contains a numbers or an objects:

  areas: [12, 50, {
    apartmentNumber: '24',
    area: '44.4'
  }]

Api

  • extract()<Promise> - request and parse data
  • parse(rawText: String)<Object> - parse passed string
  • requestRawData()<String> - request and return string

License

Under MIT license

Current Tags

  • 1.0.1                                ...           latest (3 years ago)

4 Versions

  • 1.0.1                                ...           3 years ago
  • 0.0.3                                ...           3 years ago
  • 0.0.2                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 4
This Month 6
Last Day 0
Last Week 1
Last Month 2
Dependencies (4)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |