{
  "version": "1.0.0",
  "exported_at": "2026-06-03T13:55:00.000Z",
  "project": {
    "name": "Amazon Most Gifted Scraper by category",
    "description": "Scrapes Amazon ranking/category pages equivalent to the Octoparse Amazon Most Gifted/Most Wished For by category template. Extracts category/subcategory metadata plus product ranking, title, URL, image URL, review URL, rating, rating count, and price. Pagination is handled with a known URL list: the supplied Amazon Device Accessories category page 1, page 2, and the supplied Adapters & Connectors subcategory page are visited with append-mode CSV export. Edit the Navigate urls[] list to add other Amazon category or subcategory pages. Amazon may show CAPTCHA or bot checks; if so, pause and solve manually before resuming.",
    "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 size",
      "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/most-wished-for/amazon-devices/370783011/ref=zg_mw_nav_amazon-devices_1",
          "https://www.amazon.com/gp/most-wished-for/amazon-devices/370783011/ref=zg_mw_pg_2_amazon-devices?ie=UTF8&pg=2",
          "https://www.amazon.com/gp/most-wished-for/amazon-devices/17942903011/ref=zg_mw_nav_amazon-devices_2_370783011"
        ],
        "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": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "selector": "#gridItemRoot",
        "timeout": 45,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1464,
      "position_y": 220,
      "config": {
        "rowSelector": "#gridItemRoot",
        "fileName": "amazon-most-gifted-scraper-clean.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "subcategory_url",
            "selector": "'https://www.amazon.com/gp/most-wished-for/amazon-devices/370783011/ref=zg_mw_nav_amazon-devices_1'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "subcategory_name",
            "selector": "'Most Wished For in Amazon Device Accessories'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "sub_subcategory_name",
            "selector": "(function(){if(/17942903011/.test(location.href)){return 'Adapters & Connectors';}const h=Array.from(document.querySelectorAll('h1')).map(e=>(e.textContent||'').replace(/\\s+/g,' ').trim()).find(t=>/^Most Wished For in/i.test(t));return h?h.replace(/^Most Wished For in\\s+/i,'').trim():'Amazon Device Accessories';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "sub_subcategory_url",
            "selector": "(function(){if(/17942903011/.test(location.href)){return 'https://www.amazon.com/gp/most-wished-for/amazon-devices/17942903011/ref=zg_mw_nav_amazon-devices_2_370783011';}return 'https://www.amazon.com/gp/most-wished-for/amazon-devices/370783011/ref=zg_mw_nav_amazon-devices_1';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_title",
            "selector": "(function(){const img=ROW.querySelector('img');const candidates=Array.from(ROW.querySelectorAll('a span,a div,span,div')).map(e=>(e.textContent||'').replace(/\\s+/g,' ').trim()).filter(t=>t&&!/^#\\d+/.test(t)&&!/out of 5 stars/i.test(t)&&!/^\\$/.test(t)&&!/^[\\d,]+$/.test(t)&&!/Best Sellers|New Releases/i.test(t));const long=candidates.find(t=>t.length>15);return long||(img&&img.alt?img.alt.trim():'');})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_url",
            "selector": "(function(){const a=ROW.querySelector('a[href*=\"/dp/\"]');return a?new URL(a.getAttribute('href'),location.origin).href:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ranking",
            "selector": "(function(){const r=ROW.querySelector('.zg-bdg-text');if(r&&r.textContent.trim())return r.textContent.trim();const m=(ROW.textContent||'').match(/#\\s*\\d+/);return m?m[0].replace(/\\s+/g,''):'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_image_url",
            "selector": "(function(){const img=ROW.querySelector('img');return img?(img.currentSrc||img.src||img.getAttribute('src')||''):'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_review_url",
            "selector": "(function(){const review=ROW.querySelector('a[href*=\"product-reviews\"]');if(review)return new URL(review.getAttribute('href'),location.origin).href;const product=ROW.querySelector('a[href*=\"/dp/\"]');if(!product)return '';const href=new URL(product.getAttribute('href'),location.origin).href;const m=href.match(/\\/dp\\/([A-Z0-9]{10})/);return m?location.origin+'/product-reviews/'+m[1]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating",
            "selector": "(function(){const el=ROW.querySelector('.a-icon-alt');return el?(el.textContent||'').trim():'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating_count",
            "selector": "(function(){const review=ROW.querySelector('a[href*=\"product-reviews\"]');if(review){const nums=(review.textContent||'').match(/[\\d,]+/g)||[];return nums.length?nums[nums.length-1]:'';}const txt=(ROW.textContent||'').replace(/\\s+/g,' ');const m=txt.match(/out of 5 stars\\s*([\\d,]+)/i);return m?m[1]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": "(function(){const texts=Array.from(ROW.querySelectorAll('span,div')).map(e=>(e.textContent||'').replace(/\\s+/g,' ').trim()).filter(Boolean);const price=texts.find(t=>/^\\$\\s*\\d/.test(t));return price||'';})()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 1800,
      "position_y": 220,
      "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": "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": 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",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1392,
      "position_y": 116,
      "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": 1728,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Amazon ranking/category pages equivalent to the Octoparse Amazon Most Gifted/Most Wished For by category template. Extracts category/subcategory metadata plus product ranking, title, URL, image URL, review URL, rating, rating count, and price. Pagination is handled with a known URL list: the supplied Amazon Device Accessories category page 1, page 2, and the supplied Adapters & Connectors subcategory page are visited with append-mode CSV export. Edit the Navigate urls[] list to add other Amazon category or subcategory pages. Amazon may show CAPTCHA or bot checks; if so, pause and solve manually before resuming.",
      "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-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (subcategory_url, subcategory_name, sub_subcategory_name, sub_subcategory_url, product_title). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1664,
      "position_y": 200,
      "width": 340,
      "height": 144,
      "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": 2000,
      "position_y": 200,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}