Code Monkey home page Code Monkey logo

zapimoveis_scraper's Introduction

Zap Imóveis - Scraper

A scraper that gathers data from Zap Imóveis website.

Installation

You need docker installed in your machine in order to pull and run Splash.

Major requirements
Python 3.6
Docker
PostgreSQL

1. Pull Splash image from docker

After you have docker installed, you just need to run:

$ docker pull scrapinghub/splash

2. Install Python requirements

Inside the project folder, install python requirements using pip:

$ pip install -r requirements.txt

3. Create the database

After installing PostgreSQL, create the database:

$ createdb zapimoveis

Usage

First, start the Splash server (or just run the shell script $ ./run_splash.sh)

$ docker run -p 8050:8050 scrapinghub/splash

Then run the crawler:

$ scrapy crawl zap [-a place=<(e.g. pe+olinda)>] \
                   [-a start=n] [-a count=n] [-a expiry=[nw][nd][nh][nm]]

Arguments:

  • count: limits the number of listing pages the crawler will search for. The default is to crawl till the end.

  • start: start crawling from a given page. The default is 1.

  • expiry: every time an item is inserted or updated, it's given an updated_time attribute. You can determine for how long the items remains valid by passing a timespan (e.g. 1h). By default all items in the database are considered valid.

  • place: a place you want to search, following the Zapimoveis URL format. Default: pe+recife.

Examples

  • Default values - Recife-PE, crawl all pages, don't scrape items already in the database:

    $ scrapy crawl zap
    
  • Olinda-PE, crawl 4 pages, scrape again items older than 1 day and 12 hours:

    $ scrapy crawl zap -a count=4 -a place=pe+olinda -a expiry=1d12h
    
  • Rio de Janeiro-RJ - south zone, crawl to the end, starting at page 100:

    $ scrapy crawl zap -a start=100 -a place=rj+rio-de-janeiro+zona-sul
    
  • All places, starting from page 4, crawl 3 pages:

    $ scrapy crawl zap -a start=4 -a count=3 -a place=all
    

zapimoveis_scraper's People

Contributors

pauloromeira avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.