{
  "version": "1.0.0",
  "exported_at": "2026-06-03T00:00:00.000Z",
  "project": {
    "name": "Amazon Product Details Scraper US",
    "description": "Best-effort Amazon US product detail scraper equivalent to the Octoparse ASIN-input template. It navigates through a list of Amazon /dp/{ASIN} URLs, waits for each product page, checks that a product title exists, then appends product details such as ASIN, title, brand, price, rating, review count, cleaned availability, seller, category, bullet points, image URL, and page URL to a CSV. Replace or extend the navigate.urls list with the desired ASIN-derived Amazon US product URLs. This is a multi-URL ASIN navigation workflow using navigate.urls[] plus loop-continue and fileMode append. Amazon may block automation with CAPTCHA, bot checks, location prompts, or unavailable products; pages without #productTitle are skipped.",
    "color": "bg-[#ff9900]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Set browser window dimensions",
      "position_x": 120,
      "position_y": 220,
      "config": {
        "width": 1920,
        "height": 1080,
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 456,
      "position_y": 220,
      "config": {
        "urls": [
          "https://www.amazon.com/dp/B08N5WRWNW",
          "https://www.amazon.com/dp/B07FZ8S74R",
          "https://www.amazon.com/dp/B09B8V1LZ3"
        ],
        "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": 792,
      "position_y": 220,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1464,
      "position_y": 220,
      "config": {
        "selector": "#productTitle"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1800,
      "position_y": 520,
      "config": {
        "rowSelector": "body",
        "fileName": "amazon-produits-details-scraper-via-asin-us.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "asin",
            "selector": "(() => { const urlMatch = window.location.href.match(/\\/(?:dp|gp\\/product)\\/([A-Z0-9]{10})/i); if (urlMatch) return urlMatch[1]; const detailText = ROW.innerText || ''; const textMatch = detailText.match(/ASIN\\s*[:\\n]\\s*([A-Z0-9]{10})/i); return textMatch ? textMatch[1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "title",
            "selector": "(() => { return ROW.querySelector('#productTitle')?.textContent?.trim() || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "brand",
            "selector": "(() => { const overviewBrand = ROW.querySelector('tr.po-brand td:nth-child(2) span, .po-brand .a-span9 span'); if (overviewBrand?.textContent?.trim()) return overviewBrand.textContent.trim(); const byline = ROW.querySelector('#bylineInfo')?.textContent?.trim() || ''; return byline.replace(/^Visit the\\s+/i, '').replace(/\\s+Store$/i, '').replace(/^Brand:\\s*/i, '').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": "(() => { const price = ROW.querySelector('#corePrice_feature_div .a-price .a-offscreen, #corePriceDisplay_desktop_feature_div .a-price .a-offscreen, #priceblock_ourprice, #priceblock_dealprice, #priceblock_saleprice, .a-price .a-offscreen'); return price?.textContent?.trim() || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "currency",
            "selector": "(() => { const price = ROW.querySelector('#corePrice_feature_div .a-price .a-offscreen, #corePriceDisplay_desktop_feature_div .a-price .a-offscreen, #priceblock_ourprice, #priceblock_dealprice, #priceblock_saleprice, .a-price .a-offscreen')?.textContent?.trim() || ''; const match = price.match(/^([^\\d\\s]+)/); return match ? match[1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating",
            "selector": "(() => { const rating = ROW.querySelector('#acrPopover .a-icon-alt, #averageCustomerReviews .a-icon-alt, i.a-icon-star .a-icon-alt'); return rating?.textContent?.trim() || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "review_count",
            "selector": "(() => { const reviews = ROW.querySelector('#acrCustomerReviewText, #reviewsMedley .a-size-base'); return reviews?.textContent?.trim() || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "availability",
            "selector": "(() => { const el = ROW.querySelector('#availability'); if (!el) return ''; const clone = el.cloneNode(true); clone.querySelectorAll('script, style, noscript, template').forEach(n => n.remove()); let text = (el.innerText || clone.textContent || '').replace(/\\s+/g, ' ').trim(); text = text.replace(/P\\.when\\([\\s\\S]*$/i, '').replace(/\\{[\\s\\S]*\\}$/g, '').replace(/\\s+/g, ' ').trim(); const patterns = [ /Currently unavailable\\.?(?: We don't know when or if this item will be back in stock\\.)?/i, /In Stock/i, /Only \\d+ left in stock[^.]*\\.?/i, /Usually ships[^.]*\\.?/i, /Temporarily out of stock\\.?/i, /Available from these sellers\\.?/i, /This item cannot be shipped[^.]*\\.?/i ]; for (const pattern of patterns) { const match = text.match(pattern); if (match) return match[0].trim(); } return text; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "seller",
            "selector": "(() => { const direct = ROW.querySelector('#sellerProfileTriggerId, #merchant-info a'); if (direct?.textContent?.trim()) return direct.textContent.replace(/\\s+/g, ' ').trim(); const merchant = ROW.querySelector('#merchant-info'); if (merchant?.innerText?.trim()) return merchant.innerText.replace(/\\s+/g, ' ').trim(); const buyboxRows = Array.from(ROW.querySelectorAll('#tabular-buybox tr')); for (const row of buyboxRows) { if (/Sold by/i.test(row.innerText || '')) { const cells = Array.from(row.querySelectorAll('td, span')).map(x => x.textContent.replace(/\\s+/g, ' ').trim()).filter(Boolean); const soldBy = cells.filter(x => !/^Sold by$/i.test(x)).pop(); if (soldBy) return soldBy; } } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "category",
            "selector": "(() => { return Array.from(ROW.querySelectorAll('#wayfinding-breadcrumbs_feature_div a, #wayfinding-breadcrumbs_container a')).map(a => a.textContent.trim()).filter(Boolean).join(' > '); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "bullet_points",
            "selector": "(() => { return Array.from(ROW.querySelectorAll('#feature-bullets ul li span.a-list-item')).map(el => el.textContent.replace(/\\s+/g, ' ').trim()).filter(Boolean).join(' | '); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "best_sellers_rank",
            "selector": "(() => { const text = ROW.innerText || ''; const match = text.match(/Best Sellers Rank\\s*([\\s\\S]{0,300}?)(?:Date First Available|Customer Reviews|Warranty|Feedback|$)/i); return match ? match[1].replace(/\\s+/g, ' ').trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url",
            "selector": "(() => { const img = ROW.querySelector('#landingImage, #imgBlkFront, #main-image'); return img?.getAttribute('data-old-hires') || img?.getAttribute('src') || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_url",
            "selector": "(() => { return window.location.href.split('?')[0]; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2136,
      "position_y": 520,
      "config": {}
    }
  ],
  "connections": [
    {
      "from_block_id": "set-window-size-1",
      "from_connector_id": "right",
      "to_block_id": "navigate-1",
      "to_connector_id": "left"
    },
    {
      "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": "sleep-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-1",
      "from_connector_id": "right",
      "to_block_id": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "true",
      "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"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "loop-continue-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 48,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "set-window-size-1"
        ]
      }
    },
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 384,
      "position_y": 116,
      "width": 992,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1392,
      "position_y": 116,
      "width": 992,
      "height": 596,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1728,
      "position_y": 416,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort Amazon US product detail scraper equivalent to the Octoparse ASIN-input template. It navigates through a list of Amazon /dp/{ASIN} URLs, waits for each product page, checks that a product title exists, then appends product details such as ASIN, title, brand, price, rating, review count, cleaned availability, seller, category, bullet points, image URL, and page URL to a CSV. Replace or extend the navigate.urls list with the desired ASIN-derived Amazon US product URLs. This is a multi-URL ASIN navigation workflow using navigate.urls[] plus loop-continue and fileMode append. Amazon may block automation with CAPTCHA, bot checks, location prompts, or unavailable products; pages without #productTitle are skipped.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-navigate-1",
      "element_type": "note",
      "title": "Note: Navigate",
      "content": "Multi-URL loop over 3 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 656,
      "position_y": 200,
      "width": 328,
      "height": 107,
      "z_index": 22,
      "data": {
        "block_id": "navigate-1"
      }
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `#productTitle`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1664,
      "position_y": 200,
      "width": 340,
      "height": 134,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (asin, title, brand, price, currency). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2000,
      "position_y": 500,
      "width": 340,
      "height": 125,
      "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": 2336,
      "position_y": 500,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}