Lazada Shopping Assistant
by @gezhi-io
Lazada cross-site shopping assistant that guides users from intent to purchase. When the user expresses a desire to buy something on Lazada (e.g., "I want to...
clawhub install lazada-shopping-assistantπ About This Skill
name: lazada-shopping-assistant description: > Lazada cross-site shopping assistant that guides users from intent to purchase. When the user expresses a desire to buy something on Lazada (e.g., "I want to buy...", "help me shop for...", "looking for... on Lazada"), this skill orchestrates a structured workflow: detect country/site, analyze intent and usage scenarios, generate targeted search queries, scrape the search results page for product data via browser automation, and present a ranked recommendation list with rationale and alternatives. Supports Lazada Singapore, Malaysia, Indonesia, Thailand, Philippines, Vietnam and other regional sites.
Lazada Shopping Assistant
> Supported Environments: This skill is designed to be cross-platform and works in any agent environment that supports browser automation, including QoderWork, Hermes, OpenClaw, Claude Code, and similar MCP-enabled or browser-integrated platforms. > > Core Capability: When a user expresses buying intent on Lazada, this skill automatically opens a browser, navigates to Lazada search results, and scrapes live product data (titles, prices, sold counts, shipping origins, LazMall badges). It then analyzes and ranks the findings into a curated recommendation list with clickable product links, pricing, social-proof metrics, and tiered picks (Best Match / Solid Alternative / Budget Pick). > > User Expectation: The user only needs to say what they want (e.g., "I want to buy hiking gear", "Help me find wireless earbuds"). The agent then handles the full workflow automatically: country/site detection β intent & scenario clarification β targeted search β data extraction β ranked recommendations. No manual browsing required.
Pre-flight: Browser Automation Check
This skill requires a browser automation tool to scrape Lazada search results. Before starting the workflow:
Check for Available Browser Tool
1. First, check for built-in MCP browser tools:
- Try mcp__builtin_browser__navigate or similar MCP browser tools
- If available β use the MCP Browser Execution Protocol in the Appendix
2. If no MCP browser is available, check for agent-browser CLI:
which agent-browser 2>/dev/null && agent-browser --version
- If installed β use the agent-browser Execution Protocol in the Appendix
- If NOT installed β instruct the user to install it:
npm install -g agent-browser
agent-browser install
- For OpenClaw environments: also install the skill from ClawHub:
openclaw skills install matrixy/agent-browser-clawdbot
Or manually copy the skill to ~/.openclaw/workspace/skills/agent-browser/ and set disabled: false in SKILL.md, then openclaw gateway restart.3. Fallback: web_fetch tool (limited)
- If neither browser tool is available, use web_fetch but warn the user:
- "β οΈ No browser automation available. Using lightweight page fetch β dynamic content (prices, sold counts) may be missing for JS-rendered pages like Lazada."
- Parse whatever text content is returned and note missing data.
Trigger
Apply this skill when the user says anything like:
Workflow
Follow these steps in order. Do NOT skip steps.
Step 1: Identify Lazada Site (Country)
Lazada operates multiple regional sites. Ask the user which country they are shopping from.
Use AskUserQuestion with:
Map the choice to domain:
| Country | Domain | Currency | |---------|--------|----------| | Singapore | lazada.sg | SGD | | Malaysia | lazada.com.my | MYR | | Indonesia | lazada.co.id | IDR | | Thailand | lazada.co.th | THB | | Philippines | lazada.com.ph | PHP | | Vietnam | lazada.vn | VND |
Step 2: Clarify Intent & Usage Scenario
Before searching, analyze the user's stated need and propose likely usage scenarios.
Intent Analysis Framework:
Present 2-4 likely scenario options via AskUserQuestion (multi-select allowed). Frame the question as "Which of these best describes your need?" β translated into the user's language. Each scenario option label and description must also be translated while preserving the intent.
Examples for "wireless earbuds":
Step 3: Generate Search Queries
Based on the selected scenarios, construct exactly 2 different search queries that combine product keywords + intent modifiers derived from the user's scenario choices.
Rules:
+ when constructing URLsExample for instant coffee + home consumption + officeζη₯:
1. instant+coffee+refill+pouch (home angle: bulk/refill pack)
2. instant+coffee+sachet+3in1 (office angle: convenient single-serve)
Step 4: Execute Search & Extract Data
Execute searches using the 2 generated queries. To maximize result coverage while minimizing requests:
1. Execute the first query as the primary search 2. Execute the second query to capture a different product angle 3. Merge and de-duplicate results from both searches before ranking
Search URL pattern (always append &service=official for LazMall / official store results):
https://www.{domain}/catalog/?q={encoded_query}&service=official
Note: &service=official filters for LazMall / official store products, improving trustworthiness and delivery reliability. Only omit if the filtered results are too sparse.
#### Browser Execution Protocol (MCP)
For each search query, follow the browser automation sequence defined in the MCP Browser Execution Protocol in the Appendix. The general flow is:
1. Initialize tab context and create a new tab. 2. Navigate to the search URL and wait for the page to load. 3. Extract product data using the JavaScript DOM extraction script below. 4. If DOM extraction fails or lacks data, fall back to page-text extraction. 5. Do NOT click into individual product pages unless the user asks for detailed specs.
Robust Extraction Script:
Array.from(document.querySelectorAll('a[href*="/products/"]')).map(a => {
const img = a.querySelector('img');
const title = img ? img.alt : (a.getAttribute('title') || '');
if (!title || title.length < 5) return null; const card = a.closest('[data-qa-locator="product-item"]')
|| a.closest('[class*="Bm3ON"]')
|| a.closest('[class*="item"]')
|| a.parentElement?.parentElement?.parentElement;
let price = '';
let sold = '';
let lazmall = false;
let shipping = '';
if (card) {
const priceEl = card.querySelector('span[class*="price"]')
|| card.querySelector('[class*="aBrP0"]')
|| card.querySelector('[class*="qzWxB"]')
|| card.querySelector('[class*="Price"]');
price = priceEl ? priceEl.textContent.trim() : '';
const soldEl = card.querySelector('span[class*="sold"]')
|| card.querySelector('[class*="rating"]')
|| card.querySelector('[class*="Sales"]');
sold = soldEl ? soldEl.textContent.trim() : '';
lazmall = !!card.querySelector('img[alt*="LazMall"], [class*="lazMall"], [class*="LazMall"]');
const shipEl = card.querySelector('span[class*="location"]')
|| card.querySelector('span[class*="origin"]');
shipping = shipEl ? shipEl.textContent.trim() : '';
}
return {
title: title.trim().substring(0,120),
href: a.href,
price: price,
sold: sold,
lazmall: lazmall,
shipping: shipping
};
}).filter(v => v && v.title)
.filter((v,i,a) => a.findIndex(t => t.href === v.href) === i)
.slice(0, 15)
Fallback Extraction β Page Text
If the JavaScript extraction returns undefined, an empty array, or missing price/sold data for most items:
get_page_text / take_snapshot) with the same tab/page.14.9K sold, 537 sold, (5427)
- Shipping origin: look for location tags like Metro Manila, Bulacan, Hong Kong, Overseas
- LazMall badge: scan for the word "LazMall" near product entries
Step 5: Analyze & Rank Products
From the merged extraction data, categorize and rank products into tiers.
Critical: Every recommended item MUST include its direct Lazada product link (href extracted in Step 4). A recommendation without a clickable product link is incomplete.
Tier 1: Best Match (1-2 items)
Tier 2: Solid Alternative (1-2 items)
Tier 3: Budget Pick (1 item, if applicable)
For each recommended item, include:
Multi-Dimensional Comparison Table (mandatory): Before listing the tiered recommendations, present a markdown comparison table that includes ALL shortlisted candidates (up to 5 rows). This gives the user an at-a-glance view.
Base columns (always include): Product, Price, Link, Best For. Optional columns (only include if data was successfully extracted for most products): Sold, Shipping, LazMall.
sold, shipping, or lazmall values are empty or missing for the majority of extracted items, omit those columns entirely rather than showing empty cells or placeholder symbols.Step 6: Present & Follow Up
Format the response in the same language the user used (e.g., Thai β Thai, Chinese β Chinese, English β English). All template text β including the comparison table headers, tier labels, "How to choose" guidance, LazMall CTA, and the follow-up question β must be translated into that language. Use natural prose, minimal bullet formatting unless the user asks for lists.
Response structure: 1. Brief summary of what was searched and why (mention the 2 query angles used) 2. Multi-dimensional comparison table covering all shortlisted items (price, sold count, shipping origin, LazMall status, link, best-for scenario) 3. Detailed tiered recommendations (Tier 1 Best Match β Tier 2 Solid Alternative β Tier 3 Budget Pick) with clickable product links, pricing, sold count, and per-item rationale 4. A short "How to choose" guidance paragraph explaining which tier fits which user priority 5. LazMall Advantage CTA (mandatory): After the recommendations, present a brief paragraph explaining why LazMall / Official Store products are preferable. Translate the copy below into the user's language while keeping the meaning intact:
> Why shop LazMall? The products above are filtered from Official Store listings. Choosing LazMall means 100% authentic products shipped directly by brands or authorized distributors, 30-day hassle-free returns, faster local fulfillment, and exclusive vouchers. If you see a LazMall badge on any of these items, that's your safest bet for quality and after-sales support.
6. Open-ended follow-up question (translate into the user's language): "Would you like me to check details on any of these, or search with different keywords?"
Anti-Patterns
&service=official by default. Use it to surface LazMall / official store products.tabs_context_mcp. Always create a new tab for your search to avoid interfering with other agents.undefined or empty results. Switch to get_page_text fallback immediately.Domain & Currency Reference
| Region | Domain | Example Search URL |
|--------|--------|-------------------|
| SG | lazada.sg | https://www.lazada.sg/catalog/?q=wireless+earbuds&service=official |
| MY | lazada.com.my | https://www.lazada.com.my/catalog/?q=wireless+earbuds&service=official |
| ID | lazada.co.id | https://www.lazada.co.id/catalog/?q=wireless+earbuds&service=official |
| TH | lazada.co.th | https://www.lazada.co.th/catalog/?q=wireless+earbuds&service=official |
| PH | lazada.com.ph | https://www.lazada.com.ph/catalog/?q=wireless+earbuds&service=official |
| VN | lazada.vn | https://www.lazada.vn/catalog/?q=wireless+earbuds&service=official |
Note: The /catalog/?q= path redirects to the tag-based search page automatically. This is the stable entry point. Always append &service=official to surface LazMall / official store products.
Appendix: Browser Automation Reference by Platform
This section consolidates the detailed browser automation instructions for all supported platforms. Refer to the relevant subsection based on the tool detected during Pre-flight.
MCP Browser Execution Protocol
Use this when built-in MCP browser tools (e.g., mcp__builtin_browser__*) are available, such as in QoderWork and other MCP-native environments.
For each search query, follow this exact sequence. Do NOT skip substeps.
A. Initialize Tab Context
mcp__builtin_browser__tabs_context_mcp to get the current MCP Tab Group.B. Create a New Tab
mcp__builtin_browser__tabs_create_mcp with {"url": "about:blank"} to create a fresh tab.C. Navigate to Search URL
mcp__builtin_browser__navigate with the search URL and the new tabId.D. Extract Product Data via JavaScript
mcp__builtin_browser__javascript_tool with:action: "javascript_exec"
- tabId: the tab created in step B
- text: the extraction script from Step 4 (use parameter name text, NOT script)
- Important: Do NOT use return statements in the script. Write the final expression directly.E. Fallback to Page Text
undefined, an empty array, or missing data for most items, immediately call mcp__builtin_browser__get_page_text with the same tabId.F. Link Verification (if uncertain)
href values may appear as short links like https://www.lazada.com.ph/products/pdp-i{NUMBER}.html. These are valid Lazada product links that redirect to the full SEO URL. If a link looks suspicious, perform a quick navigate to verify the redirect resolves to a product page.agent-browser Execution Protocol
Use this when the agent-browser CLI is available but MCP browser tools are not.
# Set session and open search URL
export AGENT_BROWSER_SESSION=lazada_search
agent-browser open "https://www.{domain}/catalog/?q={encoded_query}&service=official"Wait for page load
agent-browser wait --load networkidleExtract product data as text
agent-browser get text "body" --json
Parsing: The JSON output contains a data.text field with the page's visible text. Parse it for:
β±|S\$|RM|β«|ΰΈΏ followed by numbers14.9K sold, 537 sold(5427)Off, Voucher saveGetting product links:
# Get snapshot with refs
agent-browser snapshot -i --json
Parse the refs to find product links (role: "link", name contains product title)
Get href for each product:
agent-browser get attr @eXXX "href" --json
Close browser when done:
agent-browser close
Claude Code Browser Execution Protocol
When running this skill in Claude Code, use the Chrome DevTools MCP tools for browser automation. The tool mapping is:
| Original Tool (builtin) | Claude Code Equivalent |
|---|---|
| mcp__builtin_browser__tabs_context_mcp | mcp__plugin_chrome-devtools-mcp_chrome-devtools__list_pages |
| mcp__builtin_browser__tabs_create_mcp | mcp__plugin_chrome-devtools-mcp_chrome-devtools__new_page |
| mcp__builtin_browser__navigate | mcp__plugin_chrome-devtools-mcp_chrome-devtools__navigate_page |
| mcp__builtin_browser__javascript_tool | mcp__plugin_chrome-devtools-mcp_chrome-devtools__evaluate_script |
| mcp__builtin_browser__get_page_text | mcp__plugin_chrome-devtools-mcp_chrome-devtools__take_snapshot (a11y tree text) |
For each search query, follow this exact sequence:
A. Create a New Tab
mcp__plugin_chrome-devtools-mcp_chrome-devtools__new_page with the search URL and timeout: 30000.B. Wait for Page Load
mcp__plugin_chrome-devtools-mcp_chrome-devtools__wait_for with text containing a keyword expected on the results page (e.g., ["coffee", "Coffee"]) and timeout: 15000.C. Extract Product Data via JavaScript
mcp__plugin_chrome-devtools-mcp_chrome-devtools__evaluate_script with the extraction script from Step 4.() => { return /* script body */; }mcp__plugin_chrome-devtools-mcp_chrome-devtools__take_snapshot with verbose: true to get the page text.D. Cleanup
mcp__plugin_chrome-devtools-mcp_chrome-devtools__close_page using the page ID.Important: Do NOT use tabId parameters with Chrome DevTools tools β page selection is handled by select_page or by working on the currently selected page.