Personal ProjectChrome Extensions
AutoTrader NZ Car Scraper Extension
An intelligent Chrome extension that automates scraping of car listings from AutoTrader NZ and other marketplaces with smart pagination, duplicate detection, and export capabilities.
AutoTrader NZ Car Scraper - Chrome Extension
Project Overview
AutoTrader NZ Car Scraper is a powerful Chrome extension designed to automate the extraction of car listing data from AutoTrader NZ and other online car marketplaces. The extension intelligently navigates pages, extracts relevant vehicle information, detects duplicates, and stores the data locally for later export. With automated pagination and real-time monitoring, this extension streamlines the car data collection process, saving hours of manual work.
Key Features
- Automated Data Extraction: Scrapes car listings intelligently using multiple selector strategies
- Smart Pagination: Automatically navigates through multiple pages while maintaining data persistence
- Duplicate Detection: Prevents redundancy through title matching and phone number normalization
- Data Persistence: Saves all scraped data across pages and sessions using Chrome Storage API
- Auto-Start Functionality: Automatically resumes scraping when navigating to new paginated pages
- Real-Time Monitoring: Tracks progress and logs activity through the extension popup
- Export Capabilities: Download scraped data in JSON or CSV formats for easy analysis
- Multi-Selector Strategy: Robust fallback selectors to handle dynamic page structures
- Load More Handling: Detects and clicks “Load More” buttons automatically to reveal additional listings
- Error Recovery: Retry logic and graceful degradation ensure stable operation
Technical Stack
- Extension Architecture: Chrome Manifest V3 with service worker background script
- Content Scripts: JavaScript for DOM scraping and element detection
- Storage API: Chrome Storage API for data persistence across pages and sessions
- DOM Manipulation: querySelector strategies with fallback options for dynamic pages
- Data Formats: JSON and CSV exports
- Messaging API: Background-content script communication for real-time progress updates
- Error Logging: Console logging with clear status and error messages
Technical Implementation
The extension uses a structured three-layer architecture:
- Content Script (CarScraper Class): Performs DOM analysis, element detection, data extraction, and duplicate filtering
- Background Service Worker: Manages the extension lifecycle, message routing, auto-pagination, and storage operations
- Popup UI: Provides real-time monitoring, controls for starting/stopping scraping, and export options
Workflow:
- User Interaction (Popup UI) → Background Service Worker → Content Script (DOM Analysis → Element Detection → Data Extraction → Duplicate Filtering) → Chrome Storage (Persistence) → Auto-Pagination → Results Export (JSON/CSV)
Business Impact
- Efficiency Gains: Automates manual car data collection, saving hours of repetitive work
- Data Quality: Ensures unique datasets through duplicate detection
- Scalability: Handles large-scale scraping across multiple pages automatically
- User Experience: Simple one-click interface with real-time feedback and progress tracking
- Cost-Effective: Eliminates API costs or subscription fees
- Integration Ready: Exported data is easily transferred to other systems for further analysis