Purpose
Retrieve the rendered details of an AliExpress product page, including the page title, visible product text, and SKU/variant options exposed in the page DOM.
When to Use
Use when the caller provides an AliExpress numeric item ID or an item URL — on any AliExpress locale — and needs product information or available variants. This recipe is intended for one or more known item IDs; it does not guess opaque IDs from product names.
Workflow
- Build the direct URL
https://{locale-domain}/item/{item-id}.html, where{locale-domain}is the AliExpress host implied by the caller's URL or locale (www.aliexpress.comby default; regional hosts such asar.aliexpress.com,es.aliexpress.com, orpt.aliexpress.com) and{item-id}is the numeric ID from the caller's item URL or input. Preserve a regional gateway parameter when the caller's URL carries one — the Arabic site, for example, uses?gatewayAdapt=glo2ara. - In one browser call, navigate directly to the URL with
waitUntil: "domcontentloaded", allow the client-rendered product content to hydrate briefly, then run this evaluator on the loaded page:
(() => {
const body = document.body?.innerText || '';
const rows = [...document.querySelectorAll('[data-sku-row]')].map(row =>
[...row.children].map(option => ({
sku: option.getAttribute('data-sku-col'),
alt: option.querySelector('img')?.alt || null,
text: (option.textContent || '').trim(),
selected: option.classList.contains('selected')
}))
);
return {
url: location.href,
title: document.title,
visibleText: body,
skuOptions: rows
};
})()- For multiple supplied item IDs, repeat the same direct navigation and evaluator per ID and return one result object per product. Preserve
skuOptionsas an array of rows because products may expose multiple SKU dimensions.
Site-Specific Gotchas
- AliExpress product pages use opaque numeric IDs in
/item/{id}.html; do not invent an ID. If only a product name is supplied, resolve it through AliExpress search first and read the numeric item ID from the selected result URL before using this workflow. - Product content and SKU controls are client-rendered, so a successful
domcontentloadedcan precede hydration; allow a short post-navigation wait before evaluating. - SKU options are represented by
[data-sku-row]containers and child elements carryingdata-sku-col. Preserve both the option text and imagealt, and use theselectedclass to identify the currently selected option. document.body.innerTextmay contain localization, shipping, promotional, and seller text in addition to core product details; interpretvisibleTextas the complete rendered text rather than a narrowly normalized field set.- Redirects between
www.aliexpress.comand regional hosts such asar.aliexpress.comcan occur. Use the finallocation.hrefreturned by the evaluator as the canonical loaded URL.
Expected Output
Return, for each item, an object with:
url: final loaded product URL;title: document title;visibleText: rendered page text;skuOptions: nested arrays of{sku, alt, text, selected}option objects, one array per SKU dimension.