{
  "version": "1.0.0",
  "exported_at": "2026-06-02T08:15:00.000Z",
  "project": {
    "name": "Amazon Product Detail Scraper for Italy",
    "description": "Scrapes Amazon.it product detail data equivalent to the Octoparse ASIN template: ASIN, no-result flag, product URL, title, price, brand, rating, review count, model, availability, bullets, seller, bestseller rank, available-since date, and up to 6 image URLs. Navigation uses a multi-URL loop over Amazon /dp/{ASIN} URLs generated from ASIN codes; edit navigate.urls to add or replace ASINs. Best-effort only: Amazon may block automation with CAPTCHA, regional availability, cookie consent, or changing page layouts. Availability extraction uses visible text and removes embedded Amazon script noise.",
    "color": "bg-[#ff9900]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 120,
      "position_y": 220,
      "config": {
        "urls": [
          "https://www.amazon.it/dp/B08ZJFYB9J",
          "https://www.amazon.it/dp/B0BMGXQ8LS",
          "https://www.amazon.it/dp/B0CT5T88BZ",
          "https://www.amazon.it/dp/B07W4FMSD9",
          "https://www.amazon.it/dp/B0B1TWX5HW",
          "https://www.amazon.it/dp/B09VY89HF3"
        ],
        "color": "bg-[#ff9900]",
        "tags": [
          "amazon.it",
          "asin",
          "multi-url"
        ]
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 456,
      "position_y": 220,
      "config": {
        "timeout": 45
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 792,
      "position_y": 220,
      "config": {
        "jsCode": "(() => { const btn = document.querySelector('#sp-cc-accept, input[name=\"accept\"], button[name=\"accept\"], .sp-cc-accept'); if (btn) btn.click(); document.querySelectorAll('#availability script, #availability style, #availability noscript, #merchant-info script, #merchant-info style, #merchant-info noscript, #availabilityInsideBuyBox_feature_div script, #availabilityInsideBuyBox_feature_div style').forEach(e => e.remove()); return true; })()",
        "waitForCompletion": true,
        "timeout": 5
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1464,
      "position_y": 220,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1800,
      "position_y": 220,
      "config": {
        "rowSelector": "body",
        "fileName": "crawler_dettagli_prodotto_amazon.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "ASIN",
            "selector": "(() => { const parts = location.pathname.split('/').filter(Boolean); let asin = ''; for (let i = 0; i < parts.length; i++) { const p = parts[i].toLowerCase(); if ((p === 'dp' || p === 'product') && parts[i + 1]) { asin = parts[i + 1]; break; } } if (!asin) { const k = new URLSearchParams(location.search).get('keywords') || ''; const m = k.match(/[A-Z0-9]{10}/i); asin = m ? m[0] : ''; } return asin.toUpperCase(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Nessun_risultato",
            "selector": "(() => { const txt = document.body ? (document.body.innerText || document.body.textContent || '') : ''; const hasTitle = !!document.querySelector('#productTitle'); const blocked = /captcha|robot check|enter the characters/i.test(txt); const noResult = /Nessun risultato|No results|Looking for something|couldn't find|could not find/i.test(txt); return (!hasTitle || blocked || noResult) ? 'Sì' : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Prodotto_url",
            "selector": "(() => { const c = document.querySelector('link[rel=\"canonical\"]'); return c && c.href ? c.href : location.href; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Titolo_prodotto",
            "selector": "(() => { const el = document.querySelector('#productTitle'); return el ? (el.innerText || el.textContent || '').trim().replace(/\\s+/g, ' ') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Prezzo",
            "selector": "(() => { const sels = ['#corePriceDisplay_desktop_feature_div .a-price .a-offscreen', '#corePrice_feature_div .a-offscreen', '.priceToPay .a-offscreen', '#priceblock_ourprice', '#priceblock_dealprice', '#price_inside_buybox', 'span.a-price span.a-offscreen']; for (const s of sels) { const el = document.querySelector(s); const v = el ? (el.innerText || el.textContent || '').trim() : ''; if (v) return v; } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Marchio",
            "selector": "(() => { const by = document.querySelector('#bylineInfo'); if (by && (by.innerText || by.textContent || '').trim()) return (by.innerText || by.textContent || '').trim().replace(/^Visit the\\s+/i, '').replace(/\\s+Store$/i, '').replace(/^Brand:\\s*/i, '').replace(/^Marca:\\s*/i, '').replace(/\\s+/g, ' '); const labels = ['Brand', 'Marca', 'Marchio', 'Brand Name']; const rows = document.querySelectorAll('#productOverview_feature_div tr, #prodDetails tr, #productDetails_techSpec_section_1 tr, #productDetails_detailBullets_sections1 tr'); for (const r of rows) { const k = ((r.querySelector('th, td:first-child') || {}).innerText || (r.querySelector('th, td:first-child') || {}).textContent || ''); const v = ((r.querySelector('td:last-child') || {}).innerText || (r.querySelector('td:last-child') || {}).textContent || ''); if (labels.some(l => k.toLowerCase().includes(l.toLowerCase())) && v.trim()) return v.trim().replace(/\\s+/g, ' '); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Valutazione",
            "selector": "(() => { const el = document.querySelector('#acrPopover'); let v = el ? (el.getAttribute('title') || el.innerText || el.textContent || '') : ''; if (!v) { const alt = document.querySelector('#averageCustomerReviews .a-icon-alt, i.a-icon-star .a-icon-alt'); v = alt ? (alt.innerText || alt.textContent || '') : ''; } const m = v.match(/[0-9]+([\\.,][0-9]+)?/); return m ? m[0] : v.trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Quantità_valutazioni",
            "selector": "(() => { const el = document.querySelector('#acrCustomerReviewText'); return el ? (el.innerText || el.textContent || '').trim().replace(/\\s+/g, ' ') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Nome_modello",
            "selector": "(() => { const labels = ['Model Name', 'Nome modello', 'Nome Modello', 'Model', 'Modello', 'Item model number', 'Numero modello articolo', 'Numero modello']; const rows = Array.from(document.querySelectorAll('#productOverview_feature_div tr, #prodDetails tr, #productDetails_techSpec_section_1 tr, #productDetails_detailBullets_sections1 tr, #detailBullets_feature_div li')); for (const r of rows) { const txt = (r.innerText || r.textContent || '').trim().replace(/\\s+/g, ' '); if (!txt || /^P\\.when/i.test(txt)) continue; for (const l of labels) { if (txt.toLowerCase().includes(l.toLowerCase())) { if (r.matches('tr')) { const valueCell = r.querySelector('td:last-child'); if (valueCell && (valueCell.innerText || valueCell.textContent || '').trim()) return (valueCell.innerText || valueCell.textContent || '').trim().replace(/\\s+/g, ' '); } const re = new RegExp('^.*?' + l + '\\\\s*[:：]?\\\\s*', 'i'); return txt.replace(re, '').trim(); } } } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Disponibilità",
            "selector": "(() => { const reject = v => !v || /^P\\.when/i.test(v) || /ueLogError|aod-assets|assetsLoaded|function\\s*\\(/i.test(v); const textOf = (el) => { if (!el) return ''; const c = el.cloneNode(true); c.querySelectorAll('script, style, noscript').forEach(x => x.remove()); let v = (c.innerText || c.textContent || '').trim().replace(/\\s+/g, ' '); return reject(v) ? '' : v; }; const sels = ['#availability .a-color-success', '#availability .a-color-state', '#availability span.a-size-medium', '#availability span.a-size-base', '#outOfStock .a-color-price', '#outOfStock', '#availabilityInsideBuyBox_feature_div', '#availability']; for (const s of sels) { const v = textOf(document.querySelector(s)); if (v) return v; } const body = document.body ? (document.body.innerText || '') : ''; const m = body.match(/(Currently unavailable\\.|Temporaneamente non disponibile\\.|Disponibilità immediata|Only \\d+ left in stock[^\\n]*|solo \\d+[^\\n]*|Usually dispatched[^\\n]+|In stock)/i); return m ? m[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Elenchi_puntati",
            "selector": "(() => { const items = Array.from(document.querySelectorAll('#feature-bullets ul li span.a-list-item, #feature-bullets li')).map(e => (e.innerText || e.textContent || '').trim().replace(/\\s+/g, ' ')).filter(t => t && !/Make sure this fits|Enter your model number/i.test(t) && !/^P\\.when/i.test(t)); return Array.from(new Set(items)).join('\\n'); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Venditore",
            "selector": "(() => { const reject = v => !v || /^P\\.when/i.test(v) || /ueLogError|aod-assets|assetsLoaded|function\\s*\\(/i.test(v); const textOf = (el) => { if (!el) return ''; const c = el.cloneNode(true); c.querySelectorAll('script, style, noscript').forEach(x => x.remove()); const v = (c.innerText || c.textContent || '').trim().replace(/\\s+/g, ' '); return reject(v) ? '' : v; }; const seller = document.querySelector('#sellerProfileTriggerId'); const s = textOf(seller); if (s) return s; return textOf(document.querySelector('#merchant-info')); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Posizione_bestseller",
            "selector": "(() => { const nodes = document.querySelectorAll('#detailBullets_feature_div li, #productDetails_detailBullets_sections1 tr, #productDetails_db_sections tr, #prodDetails tr'); for (const n of nodes) { const c = n.cloneNode(true); c.querySelectorAll('script, style, noscript').forEach(x => x.remove()); const t = (c.innerText || c.textContent || '').trim().replace(/\\s+/g, ' '); if (/Best Sellers Rank|Posizione bestseller|Classifica bestseller|I più venduti/i.test(t)) return t.replace(/^.*?(Best Sellers Rank|Posizione bestseller|Classifica bestseller|I più venduti)\\s*[:：]?\\s*/i, '').trim(); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Disponibile_dal",
            "selector": "(() => { const labels = ['Date First Available', 'Disponibile su Amazon.it a partire dal', 'Disponibile dal', 'Prima disponibilità']; const nodes = Array.from(document.querySelectorAll('#detailBullets_feature_div li, #productDetails_detailBullets_sections1 tr, #productDetails_db_sections tr, #prodDetails tr')); for (const n of nodes) { const c = n.cloneNode(true); c.querySelectorAll('script, style, noscript').forEach(x => x.remove()); const t = (c.innerText || c.textContent || '').trim().replace(/\\s+/g, ' '); if (!t || /^P\\.when/i.test(t)) continue; for (const l of labels) { if (t.toLowerCase().includes(l.toLowerCase())) { if (n.matches('tr')) { const valueCell = n.querySelector('td:last-child'); if (valueCell && (valueCell.innerText || valueCell.textContent || '').trim()) return (valueCell.innerText || valueCell.textContent || '').trim().replace(/\\s+/g, ' '); } const re = new RegExp('^.*?' + l + '\\\\s*[:：]?\\\\s*', 'i'); return t.replace(re, '').trim(); } } } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Immagine_url1",
            "selector": "(() => { const out = []; document.querySelectorAll('#altImages img, #imageBlock img, #main-image-container img, #landingImage').forEach(img => { const dyn = img.getAttribute('data-a-dynamic-image'); if (dyn) { try { out.push(...Object.keys(JSON.parse(dyn))); } catch(e) {} } const u = img.getAttribute('data-old-hires') || img.getAttribute('src'); if (u) out.push(u); }); return Array.from(new Set(out.filter(u => /^https?:/.test(u) && !/transparent-pixel|grey-pixel|sprite|play-icon|play-button/i.test(u))))[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Immagine_url2",
            "selector": "(() => { const out = []; document.querySelectorAll('#altImages img, #imageBlock img, #main-image-container img, #landingImage').forEach(img => { const dyn = img.getAttribute('data-a-dynamic-image'); if (dyn) { try { out.push(...Object.keys(JSON.parse(dyn))); } catch(e) {} } const u = img.getAttribute('data-old-hires') || img.getAttribute('src'); if (u) out.push(u); }); return Array.from(new Set(out.filter(u => /^https?:/.test(u) && !/transparent-pixel|grey-pixel|sprite|play-icon|play-button/i.test(u))))[1] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Immagine_url3",
            "selector": "(() => { const out = []; document.querySelectorAll('#altImages img, #imageBlock img, #main-image-container img, #landingImage').forEach(img => { const dyn = img.getAttribute('data-a-dynamic-image'); if (dyn) { try { out.push(...Object.keys(JSON.parse(dyn))); } catch(e) {} } const u = img.getAttribute('data-old-hires') || img.getAttribute('src'); if (u) out.push(u); }); return Array.from(new Set(out.filter(u => /^https?:/.test(u) && !/transparent-pixel|grey-pixel|sprite|play-icon|play-button/i.test(u))))[2] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Immagine_url4",
            "selector": "(() => { const out = []; document.querySelectorAll('#altImages img, #imageBlock img, #main-image-container img, #landingImage').forEach(img => { const dyn = img.getAttribute('data-a-dynamic-image'); if (dyn) { try { out.push(...Object.keys(JSON.parse(dyn))); } catch(e) {} } const u = img.getAttribute('data-old-hires') || img.getAttribute('src'); if (u) out.push(u); }); return Array.from(new Set(out.filter(u => /^https?:/.test(u) && !/transparent-pixel|grey-pixel|sprite|play-icon|play-button/i.test(u))))[3] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Immagine_url5",
            "selector": "(() => { const out = []; document.querySelectorAll('#altImages img, #imageBlock img, #main-image-container img, #landingImage').forEach(img => { const dyn = img.getAttribute('data-a-dynamic-image'); if (dyn) { try { out.push(...Object.keys(JSON.parse(dyn))); } catch(e) {} } const u = img.getAttribute('data-old-hires') || img.getAttribute('src'); if (u) out.push(u); }); return Array.from(new Set(out.filter(u => /^https?:/.test(u) && !/transparent-pixel|grey-pixel|sprite|play-icon|play-button/i.test(u))))[4] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Immagine_url6",
            "selector": "(() => { const out = []; document.querySelectorAll('#altImages img, #imageBlock img, #main-image-container img, #landingImage').forEach(img => { const dyn = img.getAttribute('data-a-dynamic-image'); if (dyn) { try { out.push(...Object.keys(JSON.parse(dyn))); } catch(e) {} } const u = img.getAttribute('data-old-hires') || img.getAttribute('src'); if (u) out.push(u); }); return Array.from(new Set(out.filter(u => /^https?:/.test(u) && !/transparent-pixel|grey-pixel|sprite|play-icon|play-button/i.test(u))))[5] || ''; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2136,
      "position_y": 220,
      "config": {}
    }
  ],
  "connections": [
    {
      "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": "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": "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-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 116,
      "width": 1664,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 720,
      "position_y": 116,
      "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": 1728,
      "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": 2064,
      "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.it product detail data equivalent to the Octoparse ASIN template: ASIN, no-result flag, product URL, title, price, brand, rating, review count, model, availability, bullets, seller, bestseller rank, available-since date, and up to 6 image URLs. Navigation uses a multi-URL loop over Amazon /dp/{ASIN} URLs generated from ASIN codes; edit navigate.urls to add or replace ASINs. Best-effort only: Amazon may block automation with CAPTCHA, regional availability, cookie consent, or changing page layouts. Availability extraction uses visible text and removes embedded Amazon script noise.",
      "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 6 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 320,
      "position_y": 200,
      "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: `(() => { const btn = document.querySelector('#sp-cc-accept, input[name=\"accept\"], button[name=\"accep...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 992,
      "position_y": 200,
      "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, Nessun_risultato, Prodotto_url, Titolo_prodotto, Prezzo). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2000,
      "position_y": 200,
      "width": 340,
      "height": 134,
      "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": 2336,
      "position_y": 200,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}