How zmomz/1688 works
This repository is a 1688 product-search scraper with both a command-line workflow and a chat-based web interface. Users submit product requests; the web app can translate them into search terms with Ollama, then searches 1688 through a logged-in Chrome session, optionally enriches products from detail pages, and saves results as JSON or CSV. The CLI exposes search, optional detail scraping, login, and export. Edges reflect excerpted calls or README-equivalent source-index references; unsampled behavior is not inferred.
Main entry points: app.py Web workflow · main.py CLI workflow · scraper_search.py Search scraping · scraper_detail.py Detail enrichment
Components 15
User interfaces
- Chat interface
static/chat.js - Search page
templates/index.html
Workflow orchestration
- Web workflow
app.py - CLI workflow
main.py
Browser and scraping
- Browser session
session_manager.py - Chrome login and CDP
auth.py - Search scraping
scraper_search.py - Detail enrichment
scraper_detail.py
Product data and export
- Product model
models.py - JSON and CSV export
storage.py
Language assistance
- Request translation
ollama_client.py
Other components
- User
- Ollama
- Chrome browser
- 1688 marketplace
Connections 19
- User → Chat interface: submits request
static/chat.js - Chat interface → Web workflow: sends WebSocket
static/chat.js - Web workflow → Search page: renders page
app.py - Web workflow → Request translation: translates request
app.py - Request translation → Ollama: calls API
ollama_client.py - Web workflow → Browser session: acquires session
app.py - Browser session → Chrome login and CDP: connects to Chrome
session_manager.py - Chrome login and CDP → Chrome browser: connects via CDP
auth.py - Web workflow → Search scraping: scrapes terms
app.py - CLI workflow → Chrome login and CDP: logs in or connects
main.py - CLI workflow → Search scraping: scrapes keyword
main.py - Search scraping → 1688 marketplace: reads search results
scraper_search.py - CLI workflow → Detail enrichment: requests enrichment
main.py - Detail enrichment → 1688 marketplace: reads product details
scraper_detail.py - Search scraping → Product model: creates products
scraper_search.py - Detail enrichment → Product model: enriches products
scraper_detail.py - Web workflow → JSON and CSV export: saves results
app.py - CLI workflow → JSON and CSV export: saves results
main.py - JSON and CSV export → Product model: serializes products
storage.py