Open an AliExpress Product from Search

Site aliexpress.comTask open-aliexpress-product-from-searchVersion v1Updated Jul 25, 2026Category shopping

Resolve an AliExpress product from a search query and open its opaque item-ID URL, handling the site's occasional verification challenge. This skill was captured from a live agent session on aliexpress.com and publishes here verbatim, exactly as an agent receives it.

NoteSelectors and URL schemes drift as sites change. A skill is a snapshot of what worked when it was captured, not a contract — agents re-learn it when it stops working.

Purpose

Find a product matching a supplied query on AliExpress and open the product detail page using its resolved item ID.

When to Use

Use when the caller provides a product name or search query but does not provide an AliExpress item ID or direct product URL.

Workflow

  1. Build the search URL directly: https://www.aliexpress.com/w/wholesale-{query}.html, URL-encoding the query and replacing spaces with hyphens as needed.
  2. Navigate to that URL. If AliExpress presents a verification challenge, run the browser's solver once and wait for the page to reload.
  3. On the loaded search page, resolve a product link without guessing its ID. Select the first visible anchor whose absolute or protocol-relative URL matches https://www.aliexpress.com/item/{opaque-id}.html; prefer a result whose visible title or aria-label best matches {query}. Read its complete href.
  4. Navigate directly to the normalized product URL, preserving the /item/{id}.html path and omitting tracking query parameters when possible.
  5. Extract the opened product using this self-contained evaluator on the product page:
(() => {
  const text = el => (el?.content || el?.textContent || '').replace(/\\s+/g, ' ').trim();
  const canonical = document.querySelector('link[rel="canonical"]')?.href || location.href;
  const ogTitle = text(document.querySelector('meta[property="og:title"]'));
  const title = ogTitle || text(document.querySelector('h1')) || document.title.replace(/\\s*[-|].*$/, '').trim();
  const image = text(document.querySelector('meta[property="og:image"]')) || document.querySelector('img')?.src || null;
  const price = text(document.querySelector('meta[property="product:price:amount"]')) ||
    text(document.querySelector('[class*="price" i]')) || null;
  const id = canonical.match(/\\/item\\/(\\d+)\\.html/i)?.[1] ||
    location.href.match(/\\/item\\/(\\d+)\\.html/i)?.[1] || null;
  return {id, url: canonical, title, price, image};
})()

Site-Specific Gotchas

  • AliExpress product pages use opaque numeric IDs in URLs shaped like /item/{id}.html; never fabricate an ID from the product name.
  • Search result links may be protocol-relative (//www.aliexpress.com/item/...) and may include extensive tracking parameters such as gps-id and scm; normalize them to HTTPS and retain only the item path when direct navigation is desired.
  • The homepage is dynamic and may expose misleading generic div[role="link"] or localized aria-label selectors. Prefer the wholesale search URL and anchors whose href contains /item/.
  • The site can intermittently display an anti-bot verification screen; solve it before inspecting result links and wait for the search results to reappear.
  • Product markup and price class names vary by locale and redesign. The evaluator prioritizes stable Open Graph, canonical, and heading metadata, with CSS fallbacks only for missing fields.

Expected Output

An object containing the resolved numeric id, canonical product url, product title, best-effort price, and product image URL. The browser should be left on that product detail page.

Call it

GET https://production-sfo.browserless.io/skills?token=TOKEN-HERE&domain=aliexpress.com&task=open-aliexpress-product-from-search