{
  "version": "1.0.0",
  "exported_at": "2026-06-01T07:00:00.000Z",
  "project": {
    "name": "Amazon Product Details Scraper for India",
    "description": "Scrapes Amazon product detail fields by ASIN using a multi-URL navigation loop. Replace navigate.urls with Amazon India URLs such as https://www.amazon.in/dp/{ASIN}. Exports one CSV row per product and appends all ASINs into one CSV. Uses injected JavaScript helper functions to extract Amazon fields while removing script/style noise. Amazon may block scraping with CAPTCHA, regional availability, login prompts, or layout changes.",
    "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/dp/B07T45XY8Q",
          "https://www.amazon.com/dp/B09C1CN2SN"
        ],
        "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": 840,
      "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": 1200,
      "position_y": 260,
      "config": {
        "selector": "#productTitle, #title, h1",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "jsCode": "(()=>{window.__amzClean=s=>(s||'').replace(/P\\.when\\([\\s\\S]*?\\}\\);/g,' ').replace(/@media[\\s\\S]*?\\}/g,' ').replace(/\\s+/g,' ').trim();window.__amzText=sel=>{const el=document.querySelector(sel);if(!el)return'';const c=el.cloneNode(true);c.querySelectorAll('script,style,noscript,template').forEach(e=>e.remove());return window.__amzClean(c.innerText||c.textContent||'');};window.__amzRowValue=labels=>{labels=Array.isArray(labels)?labels:[labels];const rows=document.querySelectorAll('#productDetails_detailBullets_sections1 tr,#productDetails_techSpec_section_1 tr,#productDetails_db_sections tr,#prodDetails tr');for(const wanted of labels){for(const r of rows){const k=window.__amzClean(r.querySelector('th')?.textContent).replace(/:$/,'');if(k.toLowerCase().includes(String(wanted).toLowerCase()))return window.__amzClean(r.querySelector('td')?.textContent);}}for(const wanted of labels){for(const li of document.querySelectorAll('#detailBullets_feature_div li')){const c=li.cloneNode(true);c.querySelectorAll('script,style,noscript,template').forEach(e=>e.remove());const txt=window.__amzClean(c.textContent);if(txt.toLowerCase().startsWith(String(wanted).toLowerCase()))return window.__amzClean(txt.replace(new RegExp('^'+String(wanted).replace(/[.*+?^${}()|[\\\\]\\\\]/g,'\\\\$&')+'\\\\s*:?','i'),''));}}return'';};window.__amzRows=sel=>Array.from(document.querySelectorAll(sel)).map(r=>{const cells=Array.from(r.querySelectorAll('th,td')).map(x=>window.__amzClean(x.textContent)).filter(Boolean);return cells.length>=2?cells[0].replace(/:$/,'')+': '+cells.slice(1).join(' '):'';}).filter(Boolean);window.__amzImages=()=>Array.from(new Set(Array.from(document.querySelectorAll('#landingImage,#imgTagWrapperId img,#altImages img')).map(i=>i.getAttribute('data-old-hires')||i.getAttribute('data-a-hires')||i.src||'').filter(u=>u&&/media-amazon|ssl-images-amazon/.test(u)).map(u=>u.replace(/\\._[^.]+_\\./,'.'))));window.__amzAsin=()=>{const m=location.pathname.match(/\\/dp\\/([A-Z0-9]{10})/i)||location.href.match(/\\/([A-Z0-9]{10})(?:[/?]|$)/i);return(document.querySelector('#ASIN')?.value||(m?m[1]:'')).trim();};window.scrollTo(0,document.body.scrollHeight);})();",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1920,
      "position_y": 260,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2280,
      "position_y": 260,
      "config": {
        "rowSelector": "body",
        "fileName": "amazon_product_details_scraper_for_india.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "ASIN",
            "selector": "window.__amzAsin()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Web_Page_URL",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Title",
            "selector": "window.__amzText('#productTitle')||window.__amzText('#title')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Brand",
            "selector": "window.__amzText('#bylineInfo').replace(/^Brand:\\s*/i,'').replace(/^Visit the\\s+/i,'').replace(/\\s+Store$/i,'')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Star_Rating",
            "selector": "window.__amzClean(document.querySelector('#acrPopover')?.getAttribute('title')||document.querySelector('[data-hook=\"rating-out-of-text\"]')?.textContent||document.querySelector('.reviewCountTextLinkedHistogram .a-icon-alt')?.textContent||document.querySelector('span.a-icon-alt')?.textContent||'')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Number_of_Reviews",
            "selector": "window.__amzText('#acrCustomerReviewText').replace(/[^0-9,]/g,'')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Number_of_Answered_Questions",
            "selector": "(()=>{const t=window.__amzText('#askATFLink')||window.__amzClean(document.querySelector('a[href*=\"ask/questions\"]')?.textContent||'');const m=t.match(/[\\d,]+/);return m?m[0]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Price",
            "selector": "window.__amzText('#corePrice_feature_div .a-offscreen')||window.__amzText('.priceToPay .a-offscreen')||window.__amzText('#priceblock_ourprice')||window.__amzText('#priceblock_dealprice')||window.__amzText('#price_inside_buybox')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Style",
            "selector": "window.__amzText('#variation_style_name .selection')||window.__amzText('[id*=\"variation_style\"] .selection')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Color",
            "selector": "window.__amzText('#variation_color_name .selection')||window.__amzText('[id*=\"variation_color\"] .selection')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Recent_Purchases_Count",
            "selector": "(()=>{const m=document.body.innerText.match(/\\b[\\d,.Kk+]+\\s+bought\\s+in\\s+past\\s+month/i);return m?m[0]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Inventory",
            "selector": "window.__amzText('#availability span')||window.__amzText('#availability')||window.__amzText('#outOfStock span')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Seller",
            "selector": "window.__amzText('#sellerProfileTriggerId')||window.__amzText('#merchant-info a')||window.__amzText('#tabular-buybox-truncate-1 .tabular-buybox-text')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Bullet_Points",
            "selector": "Array.from(document.querySelectorAll('#feature-bullets li span.a-list-item')).map(e=>window.__amzClean(e.textContent)).filter(Boolean).join(' | ')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Product_Information",
            "selector": "window.__amzRows('#productOverview_feature_div tr').join(' | ')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Product_Description",
            "selector": "window.__amzText('#productDescription')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Product_Details",
            "selector": "(()=>{const rows=window.__amzRows('#productDetails_detailBullets_sections1 tr,#productDetails_techSpec_section_1 tr,#productDetails_db_sections tr');document.querySelectorAll('#detailBullets_feature_div li').forEach(li=>{const c=li.cloneNode(true);c.querySelectorAll('script,style,noscript,template').forEach(e=>e.remove());const txt=window.__amzClean(c.textContent);if(txt&&!/customer reviews|feedback|lower price/i.test(txt))rows.push(txt);});return Array.from(new Set(rows)).slice(0,40).join(' | ');})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "More_Buying_Choices",
            "selector": "window.__amzText('#mbc')||window.__amzText('#olp_feature_div')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Item_Model_Number",
            "selector": "window.__amzRowValue('Item model number')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Item_Weight",
            "selector": "window.__amzRowValue('Item Weight')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Product_Dimensions",
            "selector": "window.__amzRowValue(['Product Dimensions','Package Dimensions'])",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Best_Sellers_Rank",
            "selector": "window.__amzRowValue('Best Sellers Rank')||window.__amzText('#SalesRank')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Date_First_Available",
            "selector": "window.__amzRowValue('Date First Available')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "UPC",
            "selector": "window.__amzRowValue('UPC')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "About_Brand",
            "selector": "window.__amzText('#aplusBrandStory_feature_div')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "About_Manufacturer",
            "selector": "window.__amzText('#aplus_feature_div')||window.__amzText('#manufacturer-info')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Country_of_Origin",
            "selector": "window.__amzRowValue('Country of Origin')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Manufacturer_Name",
            "selector": "window.__amzRowValue('Manufacturer')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "MPN",
            "selector": "window.__amzRowValue(['Manufacturer Part Number','MPN'])",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Number_of_Sellers",
            "selector": "(()=>{const t=window.__amzText('#olp_feature_div')||window.__amzText('#mbc');const m=t.match(/[\\d,]+\\s+(?:new|used|seller|offer)/i);return m?m[0].replace(/[^0-9,]/g,''):'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Part_Number",
            "selector": "window.__amzRowValue('Part Number')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Product_Bread_Crumb_Path",
            "selector": "Array.from(document.querySelectorAll('#wayfinding-breadcrumbs_feature_div li a')).map(e=>window.__amzClean(e.textContent)).filter(Boolean).join(' › ')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Product_Category",
            "selector": "(()=>{const crumbs=Array.from(document.querySelectorAll('#wayfinding-breadcrumbs_feature_div li a')).map(e=>window.__amzClean(e.textContent)).filter(Boolean);return crumbs.length?crumbs[crumbs.length-1]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Dimensions",
            "selector": "window.__amzRowValue(['Product Dimensions','Package Dimensions'])",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Specifications",
            "selector": "Array.from(new Set(window.__amzRows('#productOverview_feature_div tr,#productDetails_techSpec_section_1 tr,#technicalSpecifications_feature_div tr'))).slice(0,60).join(' | ')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Current_Time",
            "selector": "new Date().toISOString()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Image_URL_1",
            "selector": "window.__amzImages()[0]||''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Image_URL_2",
            "selector": "window.__amzImages()[1]||''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Image_URL_3",
            "selector": "window.__amzImages()[2]||''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Image_URL_4",
            "selector": "window.__amzImages()[3]||''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Image_URL_5",
            "selector": "window.__amzImages()[4]||''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Image_URL_6",
            "selector": "window.__amzImages()[5]||''",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2640,
      "position_y": 260,
      "config": {}
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 3000,
      "position_y": 260,
      "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": "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": "sleep-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-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"
    },
    {
      "from_block_id": "loop-continue-1",
      "from_connector_id": "right",
      "to_block_id": "end-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": 1760,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1488,
      "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": 2208,
      "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": 2568,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 2928,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Amazon product detail fields by ASIN using a multi-URL navigation loop. Replace navigate.urls with Amazon India URLs such as https://www.amazon.in/dp/{ASIN}. Exports one CSV row per product and appends all ASINs into one CSV. Uses injected JavaScript helper functions to extract Amazon fields while removing script/style noise. Amazon may block scraping with CAPTCHA, regional availability, login prompts, or layout changes.",
      "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-inject-javascript-1",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(()=>{window.__amzClean=s=>(s||'').replace(/P\\.when\\([\\s\\S]*?\\}\\);/g,' ').replace(/@media[\\s\\S]*?\\}/...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1760,
      "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": 2480,
      "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": 2840,
      "position_y": 240,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}