This Python script scrapes real estate price data for all cities from imot.bg.
It saves the results in a CSV file, making it easy to analyze trends in the real estate market.
- Language: Python 3.11+
- Libraries:
requests
,BeautifulSoup
,pandas
- Data Format: CSV
- Automation:
cron
(Linux/macOS), Task Scheduler (Windows) - Deployment: Can be run locally or automated with cloud services
- Scrapes real estate price data for all cities in imot.bg
- Saves results as CSV files
- Can be automated with
cron
(Linux/macOS) or Task Scheduler (Windows) - Uses BeautifulSoup for web scraping
- Works in Python 3.11+
First, download the project to your local machine:
git clone https://github.com/KrumYakimov/Real-Estate-Scraper.git
cd real-estate-scraper
Make sure you have Python 3.11+, then install the required libraries:
pip install -r requirements.txt
To scrape data for all cities, run:
python scraper.py
The script downloads real estate data for the date when it is run.
Date | City | District | 1-Bedroom Price | 1-Bedroom Price/m² | 2-Bedroom Price | 2-Bedroom Price/m² | 3-Bedroom Price | 3-Bedroom Price/m² | Link |
---|---|---|---|---|---|---|---|---|---|
25.02.2025 | София | Бъкстон | 120,000 | 2,000 | 180,000 | 1,800 | 250,000 | 1,700 | View |
real_estate_prices_YYYYMMDD.csv
Example: If the script is run on March 1, 2025, the file will be:
real_estate_prices_20250301.csv
You can schedule the script to run automatically every day.
- Open a terminal and edit your
crontab
:crontab -e
- Add the following line to schedule the script every day at 03:30 (change the time as needed):
30 3 * * * /path/to/python /path/to/scraper.py >> /path/to/logs/scraper.log 2>&1
/path/to/python
→ Path to your Python interpreter (e.g.,/usr/bin/python3
or from a virtual environment)./path/to/scraper.py
→ Full path toscraper.py
./path/to/logs/scraper.log
→ Optional log file to track execution.
- Open Task Scheduler (
Win + R
, then typetaskschd.msc
and pressEnter
). - Click Create Basic Task → Give it a name (e.g.,
RealEstateScraper
). - Trigger: Choose Daily and set the time (e.g., 03:30).
- Action: Select Start a program.
- Browse to Python executable:
- If using Anaconda:
C:\path\to\anaconda\envs\myenv\python.exe
- If using standard Python:
C:\path\to\python.exe
- If using Anaconda:
- Add arguments:
C:\path\to\real-estate-scraper\scraper.py
- Click Finish.
Now the script will run automatically every day at 03:30!
If you need database storage, API integration, or advanced analytics, feel free to reach out!
Contact me via GitHub Issues or email: krum.yakimov@gmail.com
Let's build something great together!
This project is open-source under the MIT License.