{
  "version": "1.0.0",
  "exported_at": "2026-06-03T14:30:00.000Z",
  "project": {
    "name": "Amazon Hot New Releases Scraper by Category",
    "description": "Scrapes Amazon Hot New Releases category pages for subcategory/category, product ranking, ASIN, product URL, image URL, title, brand, star rating, rating count, reviews link, platform, and price. Pagination is implemented with known Amazon pg=1 and pg=2 URLs from the category pagination, using append mode plus loop-continue. Best effort: Amazon may show CAPTCHA, bot checks, geo/location-specific prices, or sign-in gates for review pages.",
    "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": 260,
      "config": {
        "width": 1920,
        "height": 1080,
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 480,
      "position_y": 260,
      "config": {
        "urls": [
          "https://www.amazon.com/gp/new-releases/videogames/19497043011/ref=zg_bsnr_pg_1_videogames?ie=UTF8&pg=1",
          "https://www.amazon.com/gp/new-releases/videogames/19497043011/ref=zg_bsnr_pg_2_videogames?ie=UTF8&pg=2"
        ],
        "color": "bg-[#4589ff]",
        "tags": [
          "amazon",
          "hot-new-releases",
          "pagination"
        ]
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "duration": 2,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "selector": "div[id^=\"gridItemRoot\"]",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 260,
      "config": {
        "rowSelector": "div[id^=\"gridItemRoot\"]",
        "fileName": "amazon_hot_new_releases_scraper_by_category.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "original_url",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "category",
            "selector": "(() => { const h = Array.from(document.querySelectorAll('h1')).map(e => (e.textContent || '').trim()).find(t => t.startsWith('New Releases in ')); if (h) return h.replace('New Releases in ', '').trim(); const current = Array.from(document.querySelectorAll('a, span, li')).map(e => (e.textContent || '').trim()).find(t => /\\(Current\\)/.test(t)); return current ? current.replace(/\\s*\\(Current\\)\\s*/g, '').trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "position",
            "selector": "(() => { const root = ROW.closest('[id^=\"gridItemRoot\"]') || ROW; const lines = (root.innerText || '').split('\\n').map(t => t.trim()).filter(Boolean); return (root.querySelector('.zg-bdg-text')?.textContent || lines.find(t => /^#\\d+/.test(t)) || '').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "asin",
            "selector": "(() => { const root = ROW.closest('[id^=\"gridItemRoot\"]') || ROW; const a = Array.from(root.querySelectorAll('a[href*=\"/dp/\"]')).find(a => a.href); const m = a && a.href ? a.href.match(/\\/dp\\/([A-Z0-9]{10})/) : null; return m ? m[1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "name",
            "selector": "(() => { const root = ROW.closest('[id^=\"gridItemRoot\"]') || ROW; const lines = (root.innerText || '').split('\\n').map(t => t.replace(/\\s+/g, ' ').trim()).filter(Boolean); const rankIdx = lines.findIndex(t => /^#\\d+/.test(t)); const lineName = rankIdx >= 0 ? lines.slice(rankIdx + 1).find(t => t && !/^Sponsored$/i.test(t) && !/out of 5 stars/i.test(t) && !/^\\$/.test(t)) : ''; if (lineName) return lineName; const imgAlt = root.querySelector('img[alt]')?.getAttribute('alt') || ''; if (imgAlt.trim()) return imgAlt.replace(/\\s+/g, ' ').trim(); const texts = Array.from(root.querySelectorAll('a[href*=\"/dp/\"] span, a[href*=\"/dp/\"] div')).map(e => (e.textContent || '').replace(/\\s+/g, ' ').trim()).filter(t => t && !/^#\\d+/.test(t) && !/out of 5 stars/i.test(t) && !/^\\$/.test(t)); return texts.sort((a, b) => b.length - a.length)[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "url",
            "selector": "(() => { const root = ROW.closest('[id^=\"gridItemRoot\"]') || ROW; const a = Array.from(root.querySelectorAll('a[href*=\"/dp/\"]')).find(a => a.href); return a ? a.href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "brand",
            "selector": "(() => { const root = ROW.closest('[id^=\"gridItemRoot\"]') || ROW; const bad = /out of 5 stars|^#\\d+|^\\$|Nintendo|Windows|Android|Xbox|PlayStation|Mac|iOS|Game Boy|Switch|PC|\\d+[,.]?\\d*$/i; const texts = Array.from(root.querySelectorAll('.a-row.a-size-small, span.a-size-small.a-color-base, div[class*=\"line-clamp-1\"]')).map(e => (e.textContent || '').replace(/\\s+/g, ' ').trim()).filter(Boolean); const stable = texts.find(t => t.length <= 60 && !bad.test(t)); if (stable) return stable; const lines = (root.innerText || '').split('\\n').map(t => t.replace(/\\s+/g, ' ').trim()).filter(Boolean); const starIdx = lines.findIndex(t => /out of 5 stars/i.test(t)); const rankIdx = lines.findIndex(t => /^#\\d+/.test(t)); const between = rankIdx >= 0 && starIdx > rankIdx ? lines.slice(rankIdx + 2, starIdx).filter(t => t && !bad.test(t)) : []; return between.length ? between[between.length - 1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "stars",
            "selector": "(() => { const root = ROW.closest('[id^=\"gridItemRoot\"]') || ROW; const alt = (root.querySelector('i.a-icon-star-small span.a-icon-alt, i.a-icon-star span.a-icon-alt, .a-icon-alt')?.textContent || '').trim(); const m1 = alt.match(/\\d(?:\\.\\d)?\\s*out of\\s*5\\s*stars/i); if (m1) return m1[0]; const m2 = (root.innerText || '').match(/\\d(?:\\.\\d)?\\s*out of\\s*5\\s*stars/i); return m2 ? m2[0] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ratings",
            "selector": "(() => { const root = ROW.closest('[id^=\"gridItemRoot\"]') || ROW; const reviewLink = Array.from(root.querySelectorAll('a[href*=\"product-reviews\"]')).find(a => /\\d/.test(a.textContent || '')); let txt = reviewLink ? (reviewLink.textContent || '').replace(/\\s+/g, ' ').trim() : ''; txt = txt.replace(/\\d(?:\\.\\d)?\\s*out of\\s*5\\s*stars/i, ' '); let nums = txt.match(/\\d[\\d,]*/g); if (nums && nums.length) return nums[nums.length - 1]; const all = (root.innerText || '').replace(/\\s+/g, ' '); const afterStars = all.replace(/^.*?\\d(?:\\.\\d)?\\s*out of\\s*5\\s*stars/i, ' '); nums = afterStars.match(/\\d[\\d,]*/g); return nums && nums.length ? nums[0] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "reviews_link",
            "selector": "(() => { const root = ROW.closest('[id^=\"gridItemRoot\"]') || ROW; const a = Array.from(root.querySelectorAll('a[href*=\"product-reviews\"]')).find(a => a.href); return a ? a.href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "platform",
            "selector": "(() => { const root = ROW.closest('[id^=\"gridItemRoot\"]') || ROW; const name = (() => { const lines = (root.innerText || '').split('\\n').map(t => t.replace(/\\s+/g, ' ').trim()).filter(Boolean); const rankIdx = lines.findIndex(t => /^#\\d+/.test(t)); return rankIdx >= 0 ? (lines.slice(rankIdx + 1).find(t => t && !/out of 5 stars/i.test(t) && !/^\\$/.test(t)) || '') : ''; })(); const brand = Array.from(root.querySelectorAll('.a-row.a-size-small, span.a-size-small.a-color-base, div[class*=\"line-clamp-1\"]')).map(e => (e.textContent || '').replace(/\\s+/g, ' ').trim()).find(t => t && t.length <= 60 && !/out of 5 stars|^\\$|^#\\d+/i.test(t)) || ''; const lines = (root.innerText || '').split('\\n').map(t => t.replace(/\\s+/g, ' ').trim()).filter(Boolean); const starIdx = lines.findIndex(t => /out of 5 stars/i.test(t)); const priceIdx = lines.findIndex((t, i) => i > starIdx && /^\\$\\s*\\d/.test(t)); let candidates = starIdx >= 0 ? lines.slice(starIdx + 1, priceIdx > starIdx ? priceIdx : lines.length) : lines; candidates = candidates.filter(t => t && t !== name && t !== brand && !/^\\(?\\d[\\d,]*\\)?$/.test(t) && !/out of 5 stars/i.test(t) && !/^Sponsored$/i.test(t) && !/^\\$/.test(t) && t.length < 180); const platform = candidates.find(t => /Nintendo|Windows|Android|Xbox|PlayStation|iOS|Mac|PC|Game Boy|Switch|Steam|Linux|Wii|Sega|Atari|Meta Quest|VR|Analogue|N64/i.test(t)); return platform || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": "(() => { const root = ROW.closest('[id^=\"gridItemRoot\"]') || ROW; const offscreen = (root.querySelector('.a-price .a-offscreen, span.a-offscreen')?.textContent || '').trim(); if (/^\\$\\s*\\d/.test(offscreen)) return offscreen; const text = (root.innerText || '').replace(/\\s+/g, ' '); const m = text.match(/\\$\\s*\\d[\\d,]*(?:\\.\\d{2})?/); return m ? m[0].replace(/\\s+/g, '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "picture",
            "selector": "(() => { const root = ROW.closest('[id^=\"gridItemRoot\"]') || ROW; const img = root.querySelector('img.p13n-product-image, img.a-dynamic-image, img[src]'); return img ? img.src : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "error",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2280,
      "position_y": 260,
      "config": {
        "color": "bg-[#ff832b]"
      }
    }
  ],
  "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": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-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-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 48,
      "position_y": 156,
      "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": 408,
      "position_y": 156,
      "width": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "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": 2208,
      "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 Hot New Releases category pages for subcategory/category, product ranking, ASIN, product URL, image URL, title, brand, star rating, rating count, reviews link, platform, and price. Pagination is implemented with known Amazon pg=1 and pg=2 URLs from the category pagination, using append mode plus loop-continue. Best effort: Amazon may show CAPTCHA, bot checks, geo/location-specific prices, or sign-in gates for review pages.",
      "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 2 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 680,
      "position_y": 240,
      "width": 328,
      "height": 107,
      "z_index": 22,
      "data": {
        "block_id": "navigate-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (original_url, category, position, asin, name). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 240,
      "width": 340,
      "height": 128,
      "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": 2480,
      "position_y": 240,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}