This project is a modular, production-ready system for monitoring eBay market trends. It separates concerns into distinct modules for scraping, analysis, and visualization, orchestrated by a central Celery task. It includes a real-time event monitor to track task progress.
scraper.py: Handles robust web scraping with proxy support (Bright Data) and automatic fallbacks.analizer.py: Manages the AI analysis workflow using LangGraph and Google Gemini.visualizer.py: Generates professional interactive dashboards using Bokeh.main.py: The entry point that defines the Celery task and orchestrates the pipeline.monitor.py: A real-time event listener that tracks the status of Celery tasks (Received, Started, Succeeded, Failed).
-
Install Dependencies:
pip install requests beautifulsoup4 celery redis bokeh pandas langchain langgraph langchain-google-genai python-dotenv
-
Environment Variables: Create a
.envfile in theproject3directory:GOOGLE_API_KEY=your_google_api_key BRD_USERNAME=your_proxy_username BRD_PASSWORD=your_proxy_password
-
Redis: Ensure Redis is running:
redis-server
To run the system in production mode with full monitoring, you will need three terminal windows.
Start the real-time event monitor. This will listen for updates from the worker.
cd project3
python monitor.pyStart the Celery worker. Crucial: You must use the -E flag to enable event sending so the monitor can see what's happening.
cd project3
celery -A main worker -E --loglevel=infoRun the main script to dispatch a task to the worker.
cd project3
python main.py- This will send a "gaming laptop" scraping task to the worker.
- Watch Terminal 1 to see the task progress in real-time.
- Watch Terminal 2 to see the worker logs.
If you want to run everything in a single script without a worker (for debugging), use the --local flag:
python main.py --localNote: The real-time monitor (monitor.py) will not capture events in this mode.
- CSV Data:
ebay_data_<search_term>.csv - Dashboard:
ebay_dashboard_<search_term>.html - Logs:
market_monitor.log