Skip to content

feat(jd,taobao,cnki): add JD, Taobao, and CNKI adapters#247

Closed
Muuuun wants to merge 1 commit intojackwener:mainfrom
Muuuun:feat/jd-taobao-cnki-adapters
Closed

feat(jd,taobao,cnki): add JD, Taobao, and CNKI adapters#247
Muuuun wants to merge 1 commit intojackwener:mainfrom
Muuuun:feat/jd-taobao-cnki-adapters

Conversation

@Muuuun
Copy link

@Muuuun Muuuun commented Mar 22, 2026

Summary

  • Add 7 new adapters for JD.com (京东), Taobao (淘宝), and CNKI (知网)
  • JD: full shopping workflow — search, detail, reviews, add-to-cart, view cart
  • Taobao: search with clean structured extraction from obfuscated DOM
  • CNKI: overseas portal search (oversea.cnki.net)

JD (京东) — 5 commands

Command Strategy Description
jd search <query> cookie + DOM Search products (title, price, shop, SKU)
jd detail <sku> cookie + DOM Product detail (rating, review count, tags)
jd reviews <sku> cookie + DOM User reviews extraction
jd add-cart <sku> cookie + navigate Add to cart via cart.jd.com/gate.action
jd cart cookie + API View cart contents

JD's new frontend uses fully obfuscated CSS classes — all extraction is done via div[data-sku] attribute and text pattern matching rather than class selectors.

Taobao (淘宝) — 1 command

Command Strategy Description
taobao search <query> cookie + DOM Product search with sort options (default/sale/price)

Taobao's DOM uses obfuscated class names with semantic prefixes (e.g. title--xxx, priceInt--xxx, realSales--xxx, shopName--xxx, procity--xxx). The adapter matches on these prefixes via [class*="prefix--"] selectors, producing clean structured output.

Note: Taobao search requires login. Users need to log in once in the opencli automation window.

CNKI (知网) — 1 command

Command Strategy Description
cnki search <query> cookie + DOM Chinese academic paper search

Uses oversea.cnki.net to avoid domestic access restrictions (the main kns.cnki.net returns 418 for non-browser requests and blocks CDP attach).

Test plan

  • npx tsc --noEmit — type check passed
  • npx vitest run src/ — all unit tests passed
  • opencli validate — 86 CLI definitions validated, 0 errors
  • Manual testing: JD search, detail, reviews, add-cart, cart all verified
  • Manual testing: Taobao search with clean field extraction verified
  • Manual testing: CNKI overseas search verified

🤖 Generated with Claude Code

JD (京东) — full shopping workflow:
- jd/search: product search with price, sales, shop, SKU
- jd/detail: product detail with ratings, review tags, shop info
- jd/reviews: user review extraction
- jd/add-cart: add to cart via gate.action API
- jd/cart: view cart contents via JD cart API

Taobao (淘宝) — search with clean field extraction:
- taobao/search: uses CSS class prefix matching (title--, priceInt--,
  realSales--, shopName--, procity--) to cleanly extract structured
  data from Taobao's obfuscated DOM

CNKI (知网) — overseas portal:
- cnki/search: uses oversea.cnki.net to avoid domestic access
  restrictions, extracts results from search table DOM

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Muuuun Muuuun closed this Mar 22, 2026
yunluoxin added a commit to yunluoxin/opencli that referenced this pull request Mar 22, 2026
- Add CDP-based adapter for Doubao AI chat app (豆包)
- Commands: status, send, read, new, ask, screenshot, dump
- Supports Chrome DevTools Protocol control via --remote-debugging-port
- Works on macOS with Doubao.app

Closes jackwener#247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant