A Python-based web scraper built with Playwright to extract structured real estate listings from Zonaprop and export them as JSON files.
This project scrapes property listings from Zonaprop search result pages and stores structured data in a JSON file.
It is designed to handle dynamic content rendered via JavaScript, making it suitable for modern Single Page Applications (SPA).
Zonaprop is a Single Page Application (SPA).
This means:
- The initial HTML response does not contain listing data.
- Property cards are rendered dynamically using JavaScript.
- Traditional scrapers (e.g.,
requests + BeautifulSoup) cannot access the content directly.
Playwright solves this by:
- Launching a real Chromium browser.
- Executing all JavaScript.
- Waiting for the DOM to render.
- Extracting fully loaded listing elements.
For each property listing, the scraper collects:
- Listing ID
- URL
- Price (numeric)
- Expenses (numeric)
- Address
- Location
- Total square meters
- Number of rooms
- Bedrooms
- Bathrooms
- Parking spaces
- Scraping timestamp
Duplicate listings across paginated pages are automatically filtered.
- Python 3.10+
- Playwright
Clone the repository or download the script.
(Optional) Create a virtual environment:
python -m venv venvActivate it:
Windows:
venv\Scripts\activateLinux / Mac:
source venv/bin/activateInstall dependencies:
pip install -r requirements.txtInstall Playwright browsers:
playwright installBasic usage:
python zonaprop_scraper.py "<URL>"Example:
python zonaprop_scraper.py "https://www.zonaprop.com.ar/departamentos-alquiler-caballito.html"Specify maximum number of pages:
python zonaprop_scraper.py "<URL>" 10Arguments:
- First argument: Base search URL
- Second argument (optional): Maximum number of pages to scrape (default = 5)
The script:
- Automatically creates a
data/folder if it does not exist. - Saves results as a timestamped JSON file:
data/zonaprop_YYYYMMDD_HHMMSS.json
Example:
data/zonaprop_20260212_014523.json
zonaprop-scraper/
│
├── data/
├── zonaprop_scraper.py
├── requirements.txt
└── README.md
This project is intended for educational and analytical purposes only.
Before running large-scale scraping:
- Review the website’s Terms of Service
- Respect responsible scraping practices
- Avoid excessive traffic
- If there are no properties matching the selected filters in the specified area(s), Zonaprop provides suggestions in other locations, and the scraper also extracts those suggested listings.