Skill: Amazon Product Search & Recommender
Purpose
Search Amazon for products matching user criteria (budget, material, color, etc.), extract detailed product information, and output structured recommendations in JSON format.
Core Workflow
- Parse Request: Identify the product category, budget, material, color, and any other specific constraints from the user's request.
- Navigate & Search: Go to
https://www.amazon.com, locate the main search box, and perform a search using a constructed query (e.g., "black leather sofa under 400"). - Browse Results: Navigate through the search results page to find relevant product listings.
- Extract Details: For each selected product, click into its detail page to gather accurate information:
- Canonical URL: The full product page URL.
- Title: The complete product title.
- Price: The current selling price (prioritize Prime/sale price if shown).
- Store/Brand Name: The brand or store name (e.g., from "Visit the [Brand] Store" link).
- Compile & Output: Format the extracted data into a JSON array matching the required schema and write it to the specified output file (e.g.,
recommend.json).
Key Instructions & Best Practices
- Search Query: Construct the search query by combining key attributes from the user request (color, material, product type, budget hint).
- Element Identification: Use the
browser_snapshot_searchtool with patterns like"searchbox"or"Search Amazon"to reliably locate the search input field. Avoid interacting with dropdowns or other elements near the search bar. - Result Navigation: Use
browser_snapshot_navigate_to_spanandbrowser_snapshot_search(e.g., for"price","$", product brand names) to move through the search results and identify product links and their details. - Data Accuracy: Always navigate to the product detail page (
browser_clickon product link) to capture the definitivecanonical_url,title,price, andstore_name. Do not rely solely on snippet data from search results. - Price Extraction: On the product page, search for price-related patterns (
"\\$","price"). The price is often found near elements like "Prime Member Price" or within the buy box. Extract only the numerical price (e.g., "287.99"), not currency symbols or additional text. - Store/Brand Extraction: Look for a link containing "Visit the ... Store" on the product page. The text between "Visit the " and " Store" is typically the
store_name. - Error Handling: If an action fails (e.g., clicking an element), use snapshot search and navigation tools to re-orient and find the correct element reference.
- Task Completion: After writing the final JSON file, read it back to verify its contents and call
local-claim_done.
Output Schema
The final output must be a JSON file (e.g., recommend.json) containing an array of objects. Each object must have a product_info key containing:
Scan to join WeChat group