Skip to content

Latest commit

 

History

History
166 lines (119 loc) · 4.62 KB

README.md

File metadata and controls

166 lines (119 loc) · 4.62 KB

Contributors Forks Stargazers Issues MIT License LinkedIn


Otodom & Otomoto scraper

Simple CLI application to collect data from otomoto.pl and otodom.pl

Report Bug · Request Feature

Console output

console output

JSON export format

Otodom
[
    {
        "is_sponsored": true,
        "title": "! Studio, 3 osoby, balkon, topowe wyko\u0144czenie!",
        "location": "ul. Jana Kasprowicza, Ko\u0142obrzeg, ko\u0142obrzeski, zachodniopomorskie",
        "url": "/pl/oferta/studio-3-osoby-balkon-topowe-wykonczenie-ID4eNS2",
        "image_url": "https://ireland.apollo.olxcdn.com/v1/files/eyJmbiI6Im1neTc2bWg2Y2NjbzMtQVBMIiwidyI6W3siZm4iOiJlbnZmcXFlMWF5NGsxLUFQTCIsInMiOiIxNCIsInAiOiIxMCwtMTAiLCJhIjoiMCJ9XX0.B-NT5jkKj4RAlYV-XVVUKsS4iZmP9tQdz20XF9ZB1-U/image;s=1280x1024;q=80",
        "details": {
            "total_price": "518185z\u0142",
            "price_per_meter": "18500z\u0142/m\u00b2",
            "num_of_rooms": "1 pok\u00f3j",
            "area": "28,01 m\u00b2"
        }
    },
Otomoto
[
    {
        "title": "Mercedes-Benz GLC 220 d 4-Matic AMG Line",
        "url": "https://www.otomoto.pl/osobowe/oferta/mercedes-benz-glc-glc-220d-4matic-amg-night-premium-distronic-salon-pl-fv23-ID6G2ho4.html",
        "image_url": "https://ireland.apollo.olxcdn.com/v1/files/eyJmbiI6ImJybzg0N2N3Mm50aS1PVE9NT1RPUEwifQ.eJBnMGCxy8p0QHWX74OPC9BMzAx_GWG2qvVKT2EGyYI/image;s=644x461",
        "type_of_seller": null,
        "price": "314 700",
        "price_currency": "PLN",
        "mileage": "23 772 km",
        "fuel_type": "Diesel",
        "gearbox": "Automatyczna",
        "year": "2022 "
    },

Features

  1. Scrape data from otodom.pl and otomoto.pl
  2. Parse scraped data and export them to JSON file
  3. Easy configuration, just use url with all filters included

Technologies:

Backend

  • Python
    • Typer
    • requests
    • beautifulsoup4

Installation

Clone repository

git clone https://github.com/DEENUU1/otodom-otomoto-scraper.git

Create virtual env

python -m venv venv 

Activate virtual env

.\venv\Scripts\activate

Install libraries

pip install -r requirements.txt

Change directory

cd app

Run script

python main.py <url> <page_limit> (default 1) <export_to> (default json)

For example:

python main.py https://www.otodom.pl/pl/wyniki/sprzedaz/mieszkanie/cala-polska?viewType=listing
python main.py https://www.otomoto.pl/osobowe 10 json

Authors

License

See LICENSE.txt for more information.