{
  "version": "1.0.0",
  "exported_at": "2026-06-01T23:15:00.000Z",
  "project": {
    "name": "Amazon Product Detail Scraper for Mexico",
    "description": "Scrapes Amazon.com.mx product detail pages by ASIN/product URL. Uses a multi-URL navigation loop so users can add multiple https://www.amazon.com.mx/dp/{ASIN} URLs and export one row per product. Product detail pages are single-record pages, so no listing pagination is required; loop-continue advances through the ASIN URL list. Best-effort template: Amazon may block automation with CAPTCHA, bot checks, or layout variations.",
    "color": "bg-[#ff9900]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 120,
      "position_y": 260,
      "config": {
        "urls": [
          "https://www.amazon.com.mx/dp/B0DG93MZCR",
          "https://www.amazon.com.mx/dp/B098PZZT2V"
        ],
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 480,
      "position_y": 260,
      "config": {
        "timeout": 45
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "selector": "#productTitle",
        "timeout": 45,
        "visible": true
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript on page",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "jsCode": "(()=>{const clean=s=>(s||'').replace(/\\s+/g,' ').trim();const txt=e=>clean(e&&(e.innerText||e.textContent));const q=s=>document.querySelector(s);const qa=s=>Array.from(document.querySelectorAll(s));const lower=s=>clean(s).toLowerCase();const detail=(...labels)=>{const labs=labels.map(lower);for(const tr of qa('#productDetails_techSpec_section_1 tr,#productDetails_detailBullets_sections1 tr,#productDetails_db_sections tr,table.prodDetTable tr')){const key=lower(txt(tr.querySelector('th')));if(labs.some(l=>key.includes(l)))return txt(tr.querySelector('td'));}for(const li of qa('#detailBullets_feature_div li,#detailBulletsWrapper_feature_div li')){const t=txt(li);const n=lower(t);for(const l of labs){if(n.includes(l))return clean(t.replace(/^[^:：]*[:：]/,''));}}for(const row of qa('#productOverview_feature_div tr,.po-brand,.a-normal.a-spacing-micro')){const key=lower(txt(row.querySelector('.a-span3,.a-text-bold,td:first-child,th')));if(labs.some(l=>key.includes(l)))return txt(row.querySelector('.a-span9,td:last-child'));}return '';};const getAsin=()=>{const hidden=q('#ASIN');if(hidden&&hidden.value)return hidden.value;const p=location.pathname.split('/');for(let i=0;i<p.length;i++){if((p[i]==='dp'||p[i]==='product')&&p[i+1])return p[i+1].slice(0,10);}return detail('asin');};const getPrice=()=>txt(q('.priceToPay .a-offscreen'))||txt(q('#corePriceDisplay_desktop_feature_div .a-offscreen'))||txt(q('#priceblock_ourprice'))||txt(q('#priceblock_dealprice'))||txt(q('#price_inside_buybox'))||'';const imageUrls=()=>{const out=[];const add=u=>{u=clean(u);if(u&&/^https?:\\/\\//.test(u)&&!out.includes(u))out.push(u);};for(const el of qa('#landingImage,#imgTagWrapperId img,#altImages img')){add(el.getAttribute('data-old-hires'));add(el.currentSrc);add(el.src);const dyn=el.getAttribute('data-a-dynamic-image');if(dyn){try{Object.keys(JSON.parse(dyn)).forEach(add);}catch(e){}}}return out;};const imgs=imageUrls();const bullets=qa('#feature-bullets ul li:not(.aok-hidden),#featurebullets_feature_div li').map(txt).filter(t=>t&&!/contenido|make sure/i.test(t)).join(' || ');const brandRaw=txt(q('#bylineInfo'))||detail('marca','brand');const rank=detail('clasificación en los más vendidos de amazon','clasificación en los más vendidos','best sellers rank')||txt(q('#SalesRank'));window.__USCRAPER_AMZ_DETAIL={asin:getAsin(),web_page_url:location.href,title:txt(q('#productTitle'))||document.title,brand:clean(brandRaw.replace(/^Visita la tienda de /i,'').replace(/^Marca: /i,'')),star_rating:txt(q('#acrPopover .a-icon-alt'))||txt(q('.reviewCountTextLinkedHistogram .a-icon-alt'))||txt(q('[data-hook=\"rating-out-of-text\"]')),number_of_reviews:txt(q('#acrCustomerReviewText'))||txt(q('[data-hook=\"total-review-count\"]')),inventory:txt(q('#availability'))||txt(q('#outOfStock')),bullet_points:bullets,product_description:txt(q('#productDescription'))||txt(q('#aplus_feature_div')),product_dimensions:detail('dimensiones del producto','dimensiones del paquete','product dimensions'),item_model_number:detail('número de modelo del producto','numero de modelo del producto','item model number','modelo'),date_first_available:detail('producto en amazon.com.mx desde','date first available','fecha de disponibilidad','fecha de lanzamiento'),price:getPrice(),color:txt(q('#variation_color_name .selection'))||detail('color'),best_sellers_rank:rank,image_url_1:imgs[0]||'',image_url_2:imgs[1]||'',image_url_3:imgs[2]||'',image_url_4:imgs[3]||'',image_url_5:imgs[4]||'',image_url_6:imgs[5]||'',current_time:new Date().toISOString().replace('T',' ').slice(0,19)};})();",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "rowSelector": "body",
        "fileName": "amazon_mx_detalles_scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "asin",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.asin || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "web_page_url",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.web_page_url || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "title",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.title || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "brand",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.brand || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "star_rating",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.star_rating || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "number_of_reviews",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.number_of_reviews || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "inventory",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.inventory || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "bullet_points",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.bullet_points || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_description",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.product_description || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_dimensions",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.product_dimensions || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "item_model_number",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.item_model_number || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "date_first_available",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.date_first_available || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.price || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "color",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.color || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "best_sellers_rank",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.best_sellers_rank || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url_1",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.image_url_1 || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url_2",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.image_url_2 || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url_3",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.image_url_3 || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url_4",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.image_url_4 || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url_5",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.image_url_5 || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url_6",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.image_url_6 || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "current_time",
            "selector": "window.__USCRAPER_AMZ_DETAIL && window.__USCRAPER_AMZ_DETAIL.current_time || ''",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 1920,
      "position_y": 260,
      "config": {}
    }
  ],
  "connections": [
    {
      "from_block_id": "navigate-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-page-load-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-page-load-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-1",
      "from_connector_id": "right",
      "to_block_id": "inject-javascript-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-1",
      "from_connector_id": "right",
      "to_block_id": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "loop-continue-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 156,
      "width": 1040,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1128,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "inject-javascript-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1488,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1848,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Amazon.com.mx product detail pages by ASIN/product URL. Uses a multi-URL navigation loop so users can add multiple https://www.amazon.com.mx/dp/{ASIN} URLs and export one row per product. Product detail pages are single-record pages, so no listing pagination is required; loop-continue advances through the ASIN URL list. Best-effort template: Amazon may block automation with CAPTCHA, bot checks, or layout variations.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-inject-javascript-1",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(()=>{const clean=s=>(s||'').replace(/\\s+/g,' ').trim();const txt=e=>clean(e&&(e.innerText||e.textCo...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1400,
      "position_y": 240,
      "width": 340,
      "height": 140,
      "z_index": 22,
      "data": {
        "block_id": "inject-javascript-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (asin, web_page_url, title, brand, star_rating). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 240,
      "width": 340,
      "height": 129,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-loop-continue-1",
      "element_type": "note",
      "title": "Note: Loop Continue",
      "content": "Loop Continue advances a multi-URL or multi-text loop. Place at the end of the loop body with a clear back-edge to the loop start.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 240,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}