Git Product home page Git Product logo

prop_scraper's Introduction

Python Rent Properties Scraper in CABA

This script scrapes different pages and APIs to get information about rent properties in CABA. It run its in a schedule that works everyday

.env

Complete the .env file with the following variables

HOST=${DB_HOST}
USERNAME_DB=${DB_USER}
PASSWORD_DB=${DB_PASSWORD}
DATABASE=${DB_NAME}

In the database

Create a table with the following structure

CREATE TABLE `active_properties` (
    `property_id` bigint NOT NULL AUTO_INCREMENT,
    `url` varchar(500) NOT NULL,
    `prop_type` varchar(255) NOT NULL,
    `price` bigint NOT NULL,
    `currency` varchar(255) NOT NULL,
    `expenses` bigint NOT NULL,
    `total_area` bigint NOT NULL,
    `covered_area` bigint NOT NULL,
    `rooms` int NOT NULL,
    `bedrooms` int NOT NULL,
    `bathrooms` int NOT NULL,
    `address` varchar(255) NOT NULL,
    `neighborhood` varchar(255) NOT NULL,
    `garage` int NOT NULL,
    `page` varchar(255) NOT NULL,
    `pics_urls` text,
    `last_read_date` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
    `click_count` int DEFAULT '0',
    `first_read_date` timestamp NULL DEFAULT current_timestamp(),
    PRIMARY KEY (`property_id`),
    UNIQUE KEY `url` (`url`)
) ENGINE InnoDB,
  CHARSET utf8mb4,
  COLLATE utf8mb4_0900_ai_ci;

Run with Docker using Makefile

make

To stop it

make stop

TO deleted and stop it

make clean

Run in console

install requirements.txt

pip install -r requirements.txt
python main.py

prop_scraper's People

Contributors

mpata2000 avatar

Watchers

 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.