Content
# sellersprite-rpa
A browser-based RPA + data analysis project covering **sellersprite.com** (Amazon seller analysis). Bundles 5 core Amazon data analysis skills: product ranking, keyword selection, market analysis, ABA search frequency, and competitor query.
Each skill is an independent Python tool driven by Kimi WebBridge, which automates a logged-in sellersprite session without requiring an API token or Selenium. Multi-site comparison reports are automatically generated from produced CSV files.
> English version: [README.en.md](README.en.md). This is the primary Chinese version.
## Project Significance
The sellersprite UI is comprehensive, but manual cross-site analysis is tedious. This project encapsulates its 5 core modules into scriptable scrapers with a unified CLI (`--station US,JP,GB --out X.csv`) and a report generator (`analyze.py`), transforming 30 minutes of manual clicks into 30 seconds of scripting.
The 5 skills cover the **core Amazon data analysis** of sellersprite:
| # | Skill | sellersprite Module | Returned Content |
|---|---|---|---|
| 1 | `sellersprite-products` | Product Selection | Top-selling ASINs by site + category |
| 2 | `sellersprite-keywords` | Keyword Selection | Keyword search/click/PPC data by site |
| 3 | `sellersprite-markets` | Market Selection | Niche market size + concentration |
| 4 | `sellersprite-aba` | ABA Data Selection | Amazon Brand Analytics keyword search frequency ranking |
| 5 | `sellersprite-competitors` | Competitor Query | Competitor ASINs by keyword/brand/seller/ASIN |
Appearance patents and global trademark databases are **not included** as they are IP queries, not Amazon data analysis.
## Environment Requirements
- **Kimi WebBridge daemon** (https://www.kimi.com/en/features/webbridge) running with the extension connected:
```bash
~/.kimi-webbridge/bin/kimi-webbridge status
# Expected: running: true, extension_connected: true
```
- Logged in to sellersprite within the same browser profile (free membership available, paid membership unlocks more pages/data)
- Python 3.10+ (no third-party dependencies)
## Quick Start
```bash
# Verify the daemon
~/.kimi-webbridge/bin/kimi-webbridge status
# Single-site scraping with any skill
python .claude/skills/<skill>/scripts/fetch_*.py --station US --<query-arg> X --out data/X.csv
# Multi-site + report generation
python .claude/skills/<skill>/scripts/fetch_*.py --station US,JP,GB --<query-arg> X \
--out data/by_station.csv
python .claude/skills/<skill>/scripts/analyze.py --<input> data/by_station.csv \
--out-md reports/by_station.md
```
### Quick Commands for Each Skill
```bash
# 1. Product Selection — Top 100 ASINs on the US site (5 pages × 20/page)
python .claude/skills/sellersprite-products/scripts/fetch_products.py \
--market US --pages 5 --out data/us_top100.csv
# 2. Keyword Selection — "flashlight" search data on 3 sites
python .claude/skills/sellersprite-keywords/scripts/fetch_keywords.py \
--station US,JP,GB --keyword flashlight --pages 2 \
--out data/keywords_by_station.csv
# 3. Market Selection — "led" niche market on 3 sites
python .claude/skills/sellersprite-markets/scripts/fetch_markets.py \
--station US,JP,GB --keyword led --out data/markets_by_station.csv
# 4. ABA — Amazon search frequency ranking for "yoga mat"
python .claude/skills/sellersprite-aba/scripts/fetch_aba.py \
--station US,JP,GB --query "yoga mat" --pages 3 \
--out data/aba_by_station.csv
# 5. Competitor Query — Competitor ASINs for "yoga mat" keyword
python .claude/skills/sellersprite-competitors/scripts/fetch_competitors.py \
--station US,JP,GB --keyword "yoga mat" --pages 3 \
--out data/comp_by_station.csv
```
## Architecture
Each skill adopts one of two modes:
### API-first (3 modules)
| Skill | API Endpoint | Mode |
|---|---|---|
| sellersprite-products | `POST /v3/api/product-research` | JSON body, page context fetch |
| sellersprite-aba | `POST /v3/api/aba-research` | JSON body, page context fetch |
| sellersprite-competitors | `POST /v3/api/competing-lookup` | JSON body, page context fetch |
These skills directly call APIs within the sellersprite page context using `fetch()` + `credentials: "include"`, reusing logged-in cookies without DOM scraping.
### DOM-scrape (2 modules)
| Skill | Page | Mode |
|---|---|---|
| sellersprite-keywords | `/v2/keyword-research` | URL parameter + site button click + table extraction |
| sellersprite-markets | `/v2/market-research` | POST form submission (click "Filter Market" button) + table extraction |
These modules, refactored before the v3 SPA, use traditional jQuery + Bootstrap and directly scrape rendered HTML tables.
## Common Rules Across Skills
### Site Button Click (only v2 modules)
The sellersprite v2 **ignores** the URL `?station=US` parameter. Site switching requires clicking the `<button class="station-button">` matching the Chinese label (e.g., "US (com)"). All v2 skills have a built-in `click_station_button()`, compatible with pure labels ("US") and suffixed labels ("US (com)").
### Subscription Popup Auto-Close (only v3 modules)
Each v3 page load pops up an Ant Design subscription modal. All v3 skills call `ensure_<page>_page()` at script startup, navigating to the page and automatically clicking `.ant-modal-close` to close it.
### Free Membership Data Masking
| Skill | Limitation |
|---|---|
| products | Top products `amzUnit` displayed as 100000 (actual value unknown), treat as "100k+" |
| keywords | Keywords ranked 50+ displayed as "XXX", `analyze.py` automatically filters |
| markets | No masking, returns complete data |
| aba | From page 2, returns `items: null` + `guestVisited: false`, actual visible limit = 20 keywords |
| competitors | From page 2, returns identical ASINs to page 1 (script deduplicates by ASIN), actual visible limit = 20 ASINs |
### GB Pagination Bug (products)
The GB site sometimes returns the same products on page 2 as on page 1. `sellersprite-products/scripts/analyze.py` automatically deduplicates by `(market, asin)`.
### Site Currencies
| Site | Currency |
|---|---|
| US | $ |
| JP | 円 |
| GB | £ |
| DE/FR/IT/ES | € |
| CA | $ |
| IN | ₹ |
| MX | $ |
`analyze.py` parses numerical values, stripping only `$` and `,`, and retains other currency symbols as strings.
### Site → Market Code Mapping (**inconsistent across skills**)
| Skill | US Code | Other Sites |
|---|---|---|
| products | (body uses marketplaceId=1) | integer marketplaceId |
| keywords | (URL `?station=US`) | URL parameter |
| markets | (button click, hidden input marketId=1) | integer marketId |
| aba | `COM` | 2-letter code (JP/GB/DE/...) |
| competitors | `US` | 2-letter code (JP/GB/DE/...) |
When reusing the body schema across skills, ensure the `market` field format is correct.
## Repository Structure
```
sellersprite-rpa/
├── CLAUDE.md # Claude Code project-level guidance
├── README.md # This file (primary Chinese version)
├── README.en.md # English version
├── phase1_investigation.md # Phase 1 architecture investigation report
├── .claude/skills/
│ ├── sellersprite-products/ # Product Selection (API-first)
│ ├── sellersprite-keywords/ # Keyword Selection (DOM-scrape)
│ ├── sellersprite-markets/ # Market Selection (DOM-scrape, POST form)
│ ├── sellersprite-aba/ # ABA Data Selection (API-first)
│ └── sellersprite-competitors/ # Competitor Query (API-first, search-driven)
├── data/ # CSV output
└── reports/ # Generated Markdown reports
```
Each skill directory structure:
```
sellersprite-<skill>/
├── SKILL.md # Frontmatter + Quick start + Gotchas
├── scripts/
│ ├── common.py # Shared helpers (call/evaluate/navigate/post_json/write_csv)
│ ├── fetch_<skill>.py # Main scraping script
│ └── analyze.py # Multi-site comparison report generator
└── references/
├── api_notes.md # Complete API/page schema
├── environment.md # Windows/bash/jq/heredoc notes
└── analysis_recipe.md # Report template structure
```
## Supported 10 Amazon Sites
| Code | Site | sellersprite marketId | ABA Code | Competitors Code |
|---|---|---|---|---|
| US | United States | 1 | COM | US |
| JP | Japan | 6 | JP | JP |
| GB | United Kingdom | 3 | GB | GB |
| DE | Germany | 4 | DE | DE |
| FR | France | 5 | FR | FR |
| IT | Italy | 8 | IT | IT |
| ES | Spain | 9 | ES | ES |
| CA | Canada | 2 | CA | CA |
| IN | India | 10 | IN | IN |
| MX | Mexico | 11 | MX | MX |
## Working in This Repository
Use Windows + bash shell, with forward slashes in paths and `/dev/null` (not `NUL`). No build/test/lint commands — CSV output in `data/`, reports in `reports/`.
For complex JSON payloads with regex/special characters (especially JS code), prefer Python `urllib.request` over `curl -d` — Windows GBK stdout in `curl` JSON encoding can be error-prone.
## Related Links
- `CLAUDE.md` — Claude Code project-level guidance
- `phase1_investigation.md` — Complete architecture investigation report for 5 modules
- `README.en.md` — English README
- Sister project: `D:\fastmoss-rpa\` — fastmoss.com (TikTok Shop analysis) implemented in the same mode
### Special Thanks:
https://linux.do community friends
Connection Info
You Might Also Like
No recommendations available