OLX Парсер Нерухомості Переписати
Technical Requirements - OLX Real Estate Parser Rewrite
Project Overview
The current project is a Python-based parser that extracts real estate listings from OLX.ua and sends them to an EasyBase API. The system monitors multiple OLX categories (apartments, houses, land, parking) and processes offers by extracting property details, phone numbers, and location data. When writing parser, consider that it’ll be parsing a few regions in Ukraine. So maybe there should be some split inside of codebase.
Core Functionality
• Real Estate Data Parsing: Scrapes OLX.ua listings for apartments, houses, land plots, and parking spaces
• Phone Number Extraction: Retrieves seller contact information using OLX accounts
• Location Processing: Maps coordinates to districts/microdistricts using JSON lookup files
• Data Transformation: Converts OLX format to EasyBase API format
• Account Management: Rotates through multiple OLX user accounts to avoid rate limiting
• Duplicate Prevention: Tracks parsed offers in Mongo database to avoid re-processing
Technical Requirements for Rewrite
1. Asynchronous Architecture
Mandatory: All operations must be asynchronous using async/await pattern.
• HTTP Requests: Replace `requests` with `httpx` for all API calls
• Database Operations: Use async database drivers
• File I/O: Use `aiofiles` for JSON file operations
• Concurrency: Implement concurrent processing of multiple offers
• Rate Limiting: Async-friendly rate limiting for API calls
• Session Management: Async session handling for OLX accounts
2. Database Migration to MongoDB
Mandatory: Replace SQLite with MongoDB for all data storage. Store accounts data and urls to parse inside of mongoDB.
3. User Credentials Rotation System
Mandatory: Implement robust credential management system.
Options:
- **OLX User Account Rotation** (Current approach)
- **API Developer Credentials** (Alternative approach - preferable, but should be investigated if it will be working)
Requirements:
• Automatic Token Refresh: Async background task for token renewal
• Health Monitoring: Check account status and availability
• Cooldown Management: Temporarily disable accounts that hit rate limits
• Load Balancing: Distribute requests across available accounts
• Fallback Strategy: Handle account failures gracefully
• Rotation Strategies: Round-robin, least-recently-used, random selection
5.2 Configuration Files
- `district_mapping.json`: Location mapping data
- `category_mapping.json`: OLX category to property type mapping
6. Error Handling and Monitoring
6.1 Async Error Handling
• Retry Logic: Exponential backoff for failed requests
• Circuit Breaker: Prevent cascading failures
• Graceful Degradation: Continue with available accounts
• Error Aggregation: Collect and report parsing statistics
7. Scalability Considerations
• Horizontal Scaling: Design for multiple parser instances
• Queue System: Optional message queue for offer processing
• Database Sharding: Prepare for MongoDB scaling
• Microservices Ready: Modular design for future service separation
8. Development Guidelines
8.1 Technology Stack
- **Python 3.11+**
• aiohttp: Async HTTP client
• motor: Async MongoDB driver
• pydantic: Data validation and serialization
• asyncio: Concurrency management
• aiofiles: Async file operations
* Alternative libraries are welcomed too.
8.2 Code Organization (preferable, not obligatory)
src/
├── models/
│ ├── offer.py # Offer data models
│ ├── account.py # Account models
│ └── enums.py # Constants and enums
├── parsers/
│ ├── olx_parser.py # OLX parsing logic
│ └── phone_extractor.py # Phone number extraction
├── database/
│ ├── mongodb.py # MongoDB connection and operations
│ └── repositories.py # Data access methods
├── accounts/
│ ├── manager.py # Account management
│ └── rotation.py # Account rotation logic
├── api/
│ └── easybase_client.py # EasyBase API client
├── utils/
│ ├── config.py # Configuration management
│ ├── async_helpers.py # Async utility functions
│ └── exceptions.py # Custom exceptions
└── main.py # Application entry point
Simple and Practical:
• Models: Pydantic models for data validation
• Parsers: OLX-specific parsing logic
• Database: MongoDB operations and data access
• Accounts: User account management and rotation
• API: External API clients
• Utils: Shared utilities and configuration
• Flat structure: Easy to navigate and understand
-
116 Доброго дня!
Можу виконати вашу задачу швидко та якісно.
Звертайтесь!
-
542 11 2 2 Доброго дня!
Маю досвід роботи з Python 3.11+, асинхронним програмуванням та MongoDB. Вмію ефективно організовувати парсинг даних з OLX, ротацію акаунтів, обробку помилок та масштабування системи. Завжди дотримуюсь структурованого і чистого коду, гарантую надійність та стабільність роботи проєкту.
Буду рада допомогти
-
487 4 0 Доброго дня! 👋
Ваша задача це фактично розробка повноцінного сервісу з архітектурою під масштабування.
Готовий обговорити деталі реалізації та терміни.
-
1039 6 0 Доброго дня. Маю великий досвід в роботі з python та парсингу, в тому числі й olx. Звертайтесь.
-
4031 11 0 2 Доброго дня. Зацікавив ваш проект.
Обсяг робіт:
Переписування парсера з синхронного на асинхронний (httpx/aiohttp, motor, aiofiles).
Інтеграція з MongoDB: зберігання оголошень, акаунтів, URL.
Реалізація системи ротації акаунтів OLX з автооновленням токенів і балансуванням.
Налаштування обробки помилок (retry, circuit breaker, graceful degradation).
Підключення EasyBase API з валідацією даних через Pydantic.
Підтримка масштабування (розділення по регіонах, багатопоточність через asyncio).
Базовий моніторинг + логування.