{
  "version": "1.0.0",
  "exported_at": "2026-06-03T14:00:00.000Z",
  "project": {
    "name": "Amazon Movers  Shakers Scraper by Category",
    "description": "Scrapes Amazon Movers & Shakers category ranking pages for product rank, ASIN, title, URL, image, rating, review count, reviews link, price, brand/platform heuristics, and source category. Pagination is implemented with a known two-page Amazon ranking URL list and loop-continue, appending results into one CSV. Best-effort template: Amazon may show CAPTCHA/robot checks, sign-in pages, or a no-current-movers message. If no ranking grid is present, the template writes a status row instead of failing. Review pages may require login, so this template exports review links rather than scraping reviews.",
    "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/gp/movers-and-shakers/videogames/ref=zg_bsms_nav_videogames_0",
          "https://www.amazon.com/gp/movers-and-shakers/videogames/ref=zg_bsms_pg_2?ie=UTF8&pg=2"
        ],
        "color": "bg-[#08bdba]"
      }
    },
    {
      "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": 45,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "duration": 3,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1464,
      "position_y": 220,
      "config": {
        "selector": "div[id='gridItemRoot']",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "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": "div[id='gridItemRoot']",
        "fileName": "amazon_movers_and_shakers_scraper_by_category.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "original_url",
            "selector": "window.location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "category",
            "selector": "(() => { const cur = document.querySelector('#zg_browseRoot .zg_selected, .zg_selected, [aria-current=\"page\"]'); return cur ? cur.textContent.trim() : 'Video Games (Current)'; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "position",
            "selector": "ROW.querySelector('.zg-bdg-text')?.textContent.trim() || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "asin",
            "selector": "(() => { const a = ROW.querySelector('a[href*=\"/dp/\"]'); const href = a ? a.href : ''; const m = href.match(/\\/dp\\/([A-Z0-9]{10})/); return m ? m[1] : (ROW.getAttribute('data-asin') || ''); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "name",
            "selector": "(() => { const title = ROW.querySelector('._cDEzb_p13n-sc-css-line-clamp-3_g3dy1, ._cDEzb_p13n-sc-css-line-clamp-4_2q2cc, .p13n-sc-truncate-desktop-type2, a[href*=\"/dp/\"] span div'); if (title && title.textContent.trim()) return title.textContent.trim(); const img = ROW.querySelector('img[alt]'); return img ? img.alt.trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "url",
            "selector": "(() => { const a = ROW.querySelector('a[href*=\"/dp/\"]'); return a ? a.href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "brand",
            "selector": "(() => { const candidates = Array.from(ROW.querySelectorAll('.a-size-small.a-color-base, .a-size-base.a-color-base')).map(e => e.textContent.trim()).filter(Boolean); const bad = /out of 5|\\$|^[\\d,]+$|Prime|Best Seller|Limited time/i; return candidates.find(t => !bad.test(t) && t.length < 60) || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "stars",
            "selector": "ROW.querySelector('i.a-icon-star-small span.a-icon-alt, i.a-icon-star span.a-icon-alt')?.textContent.trim() || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ratings",
            "selector": "(() => { const val = Array.from(ROW.querySelectorAll('a[href*=\"product-reviews\"] span, a[href*=\"#customerReviews\"] span')).map(e => e.textContent.trim()).find(t => /^[\\d,]+$/.test(t)); return val || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "reviews_link",
            "selector": "(() => { const a = ROW.querySelector('a[href*=\"product-reviews\"], a[href*=\"#customerReviews\"]'); if (a && a.href && !a.href.includes('#customerReviews')) return a.href; const p = ROW.querySelector('a[href*=\"/dp/\"]'); const href = p ? p.href : ''; const m = href.match(/\\/dp\\/([A-Z0-9]{10})/); return m ? `https://www.amazon.com/product-reviews/${m[1]}` : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "platform",
            "selector": "(() => { const txt = ROW.textContent || ''; const vals = ['PlayStation 5', 'PlayStation 4', 'Nintendo Switch 2', 'Nintendo Switch', 'Xbox Series X', 'Xbox Series S', 'Xbox One', 'Windows', 'Android', 'iOS', 'PC', 'Mac']; return vals.filter(v => txt.includes(v)).join(', '); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": ".a-price .a-offscreen",
            "attribute": "text"
          },
          {
            "name": "picture",
            "selector": "img.p13n-product-image, img.a-dynamic-image",
            "attribute": "src"
          },
          {
            "name": "error",
            "selector": "(() => { const body = document.body ? document.body.innerText : ''; if (/captcha|robot check/i.test(document.title + ' ' + body)) return 'CAPTCHA or robot check displayed'; if (/Sign in or create account/i.test(body)) return 'Amazon sign-in gate displayed'; return ''; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "structured-export-2",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1464,
      "position_y": 520,
      "config": {
        "rowSelector": "body",
        "fileName": "amazon_movers_and_shakers_scraper_by_category.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "original_url",
            "selector": "window.location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "category",
            "selector": "(() => { const cur = document.querySelector('#zg_browseRoot .zg_selected, .zg_selected, [aria-current=\"page\"]'); return cur ? cur.textContent.trim() : 'Video Games (Current)'; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "position",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "asin",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "name",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "url",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "brand",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "stars",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ratings",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "reviews_link",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "platform",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "picture",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "error",
            "selector": "(() => { const body = document.body ? document.body.innerText : ''; if (/captcha|robot check/i.test(document.title + ' ' + body)) return 'CAPTCHA or robot check displayed'; if (/Sign in or create account/i.test(body)) return 'Amazon sign-in gate displayed'; if (/Sorry, there are no movers and shakers available/i.test(body)) return 'No movers and shakers available in this category at run time'; return 'No Amazon ranking product grid found'; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2136,
      "position_y": 520,
      "config": {
        "duration": 2,
        "color": "bg-[#8d8d8d]"
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2472,
      "position_y": 520,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "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": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "structured-export-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "sleep-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-2",
      "from_connector_id": "right",
      "to_block_id": "sleep-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-2",
      "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": 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": 2000,
      "height": 596,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "sleep-2"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1392,
      "position_y": 116,
      "width": 1328,
      "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": 1392,
      "position_y": 416,
      "width": 656,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1",
          "structured-export-2"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Amazon Movers & Shakers category ranking pages for product rank, ASIN, title, URL, image, rating, review count, reviews link, price, brand/platform heuristics, and source category. Pagination is implemented with a known two-page Amazon ranking URL list and loop-continue, appending results into one CSV. Best-effort template: Amazon may show CAPTCHA/robot checks, sign-in pages, or a no-current-movers message. If no ranking grid is present, the template writes a status row instead of failing. Review pages may require login, so this template exports review links rather than scraping reviews.",
      "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": 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 `div[id='gridItemRoot']`. 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": 137,
      "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 (original_url, category, position, asin, name). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2000,
      "position_y": 500,
      "width": 340,
      "height": 128,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-structured-export-2",
      "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": 1664,
      "position_y": 500,
      "width": 340,
      "height": 128,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-2"
      }
    },
    {
      "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": 2672,
      "position_y": 500,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}