{
  "version": "1.0.0",
  "exported_at": "2026-06-03T15:30:00.000Z",
  "project": {
    "name": "Amazon Reviews Scraper for Italy",
    "description": "Scrapes Amazon.it product reviews for the configured ASIN, including product title, review URL, ASIN, inferred brand, overall rating, rating count, reviewer, review stars, review title, country, date, review content, and helpful votes. Uses click-next pagination to collect all publicly reachable review pages for the query. Best-effort template: Amazon may redirect to sign-in, CAPTCHA, or block automated access.",
    "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": 80,
      "position_y": 180,
      "config": {
        "width": 1920,
        "height": 1080,
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 440,
      "position_y": 180,
      "config": {
        "url": "https://www.amazon.it/product-reviews/B07C44VPWH?sortBy=helpful&reviewerType=all_reviews&filterByStar=all_stars&formatType=all_formats&mediaType=all_contents&pageNumber=1&language=en_US",
        "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": 800,
      "position_y": 180,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1160,
      "position_y": 180,
      "config": {
        "selector": "#sp-cc-accept",
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 1520,
      "position_y": 180,
      "config": {
        "selector": "#sp-cc-accept",
        "timeout": 8,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1880,
      "position_y": 180,
      "config": {
        "duration": 1,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2240,
      "position_y": 520,
      "config": {
        "duration": 2,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-2",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 2600,
      "position_y": 520,
      "config": {
        "selector": "div[data-hook='review']",
        "color": "bg-[#42be65]"
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 2600,
      "position_y": 860,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2960,
      "position_y": 520,
      "config": {
        "rowSelector": "div[data-hook='review']",
        "fileName": "amazon-reviews-scraper-italy.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "titolo_prodotto",
            "selector": "const el = document.querySelector('[data-hook=\"product-link\"]') || document.querySelector('#cm_cr-product_info a') || document.querySelector('.product-title') || document.querySelector('a[href*=\"/dp/\"]'); return el ? el.textContent.trim().replace(/\\s+/g, ' ') : '';",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "url_prodotto",
            "selector": "return location.href;",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "asin",
            "selector": "const m = location.href.match(/product-reviews\\/([A-Z0-9]{10})/i) || location.href.match(/[?&]asin=([A-Z0-9]{10})/i) || location.href.match(/\\/dp\\/([A-Z0-9]{10})/i); return m ? m[1] : '';",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "marchio",
            "selector": "const el = document.querySelector('[data-hook=\"product-link\"]') || document.querySelector('#cm_cr-product_info a') || document.querySelector('.product-title'); const title = el ? el.textContent.trim().replace(/\\s+/g, ' ') : ''; return title ? title.split(' ')[0] : '';",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "valutazione",
            "selector": "const el = document.querySelector('[data-hook=\"rating-out-of-text\"]') || document.querySelector('[data-hook=\"cr-average-stars-rating-text\"]') || document.querySelector('#cm_cr-product_info .a-icon-alt') || document.querySelector('.AverageCustomerReviews .a-icon-alt'); return el ? el.textContent.trim().replace(/\\s+/g, ' ') : '';",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "quantita_valutazioni",
            "selector": "const el = document.querySelector('[data-hook=\"total-review-count\"]') || document.querySelector('[data-hook=\"cr-filter-info-review-rating-count\"]') || document.querySelector('#filter-info-section'); return el ? el.textContent.trim().replace(/\\s+/g, ' ') : '';",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "nome_utente",
            "selector": ".a-profile-name",
            "attribute": "text"
          },
          {
            "name": "stelle_recensione",
            "selector": "const el = ROW.querySelector('i[data-hook=\"review-star-rating\"] span.a-icon-alt') || ROW.querySelector('i[data-hook=\"cmps-review-star-rating\"] span.a-icon-alt') || ROW.querySelector('[data-hook=\"review-star-rating\"] .a-icon-alt') || ROW.querySelector('.review-rating .a-icon-alt'); return el ? el.textContent.trim().replace(/\\s+/g, ' ') : '';",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "titolo_recensione",
            "selector": "const el = ROW.querySelector('[data-hook=\"review-title\"]'); let t = el ? (el.innerText || el.textContent || '') : ''; t = t.replace(/\\s+/g, ' ').trim(); t = t.replace(/^\\d+[,.]\\d+\\s+(su 5 stelle|out of 5 stars)\\s*/i, '').trim(); return t;",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "paese",
            "selector": "const el = ROW.querySelector('[data-hook=\"review-date\"]'); const t = el ? el.textContent.trim().replace(/\\s+/g, ' ') : ''; const m = t.match(/(?:Reviewed in|Recensito in)\\s+(.+?)\\s+(?:on|il)\\s+(.+)/i); return m ? m[1].trim() : '';",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "date",
            "selector": "const el = ROW.querySelector('[data-hook=\"review-date\"]'); const t = el ? el.textContent.trim().replace(/\\s+/g, ' ') : ''; const m = t.match(/(?:Reviewed in|Recensito in)\\s+(.+?)\\s+(?:on|il)\\s+(.+)/i); return m ? m[2].trim().replace(/\\s+/g, '-') : t;",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "contenuto_recensione",
            "selector": "[data-hook='review-body'] span",
            "attribute": "text"
          },
          {
            "name": "numero_di_voti_utili",
            "selector": "[data-hook='helpful-vote-statement']",
            "attribute": "text"
          }
        ]
      }
    },
    {
      "block_id": "element-exists-3",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 3320,
      "position_y": 520,
      "config": {
        "selector": "ul.a-pagination li.a-last:not(.a-disabled) a",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "end-2",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 3320,
      "position_y": 860,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    },
    {
      "block_id": "click-2",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 3680,
      "position_y": 860,
      "config": {
        "selector": "ul.a-pagination li.a-last:not(.a-disabled) a",
        "timeout": 10,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "wait-for-page-load-2",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 4040,
      "position_y": 860,
      "config": {
        "timeout": 30,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 4400,
      "position_y": 860,
      "config": {
        "selector": "div[data-hook='review']",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "sleep-3",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 4760,
      "position_y": 860,
      "config": {
        "duration": 2,
        "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": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "true",
      "to_block_id": "click-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-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": "sleep-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "sleep-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-2",
      "from_connector_id": "right",
      "to_block_id": "element-exists-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-2",
      "from_connector_id": "true",
      "to_block_id": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-2",
      "from_connector_id": "false",
      "to_block_id": "end-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "element-exists-3",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-3",
      "from_connector_id": "false",
      "to_block_id": "end-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-3",
      "from_connector_id": "true",
      "to_block_id": "click-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-2",
      "from_connector_id": "right",
      "to_block_id": "wait-for-page-load-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-page-load-2",
      "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": "sleep-3",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-3",
      "from_connector_id": "right",
      "to_block_id": "structured-export-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 8,
      "position_y": 76,
      "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": 368,
      "position_y": 76,
      "width": 4640,
      "height": 976,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "sleep-2",
          "wait-for-page-load-2",
          "wait-for-element-1",
          "sleep-3"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1088,
      "position_y": 76,
      "width": 2840,
      "height": 976,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1",
          "element-exists-2",
          "element-exists-3",
          "click-2"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 2528,
      "position_y": 756,
      "width": 1040,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1",
          "end-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 2888,
      "position_y": 416,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Amazon.it product reviews for the configured ASIN, including product title, review URL, ASIN, inferred brand, overall rating, rating count, reviewer, review stars, review title, country, date, review content, and helpful votes. Uses click-next pagination to collect all publicly reachable review pages for the query. Best-effort template: Amazon may redirect to sign-in, CAPTCHA, or block automated access.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `#sp-cc-accept`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1360,
      "position_y": 160,
      "width": 340,
      "height": 134,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-element-exists-2",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `div[data-hook='review']`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2800,
      "position_y": 500,
      "width": 340,
      "height": 138,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-2"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (titolo_prodotto, url_prodotto, asin, marchio, valutazione). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 3160,
      "position_y": 500,
      "width": 340,
      "height": 133,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-element-exists-3",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `ul.a-pagination li.a-last:not(.a-disabled) a`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 3520,
      "position_y": 500,
      "width": 340,
      "height": 145,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-3"
      }
    }
  ]
}