{
  "version": "1.0.0",
  "exported_at": "2026-06-03T16:05:00.000Z",
  "project": {
    "name": "Subito Product Scraper",
    "description": "Scrapes Subito.it listing/search result pages for title, listing URL, location, price, vehicle attributes, dealer name, and best-effort phone number. Pagination is implemented with known Subito o= page URLs from o=1 through o=56 for the sample search URL because the page reports about 1,817 results. Phone extraction attempts to click visible 'Mostra numero' buttons, but Subito may block or limit phone reveal.",
    "color": "bg-[#4589ff]",
    "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.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=1",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=2",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=3",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=4",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=5",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=6",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=7",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=8",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=9",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=10",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=11",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=12",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=13",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=14",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=15",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=16",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=17",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=18",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=19",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=20",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=21",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=22",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=23",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=24",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=25",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=26",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=27",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=28",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=29",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=30",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=31",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=32",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=33",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=34",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=35",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=36",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=37",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=38",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=39",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=40",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=41",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=42",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=43",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=44",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=45",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=46",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=47",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=48",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=49",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=50",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=51",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=52",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=53",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=54",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=55",
          "https://www.subito.it/annunci-lazio/vendita/auto/roma/roma/?q=smart&o=56"
        ],
        "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": 480,
      "position_y": 220,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Run custom JavaScript on the page",
      "position_x": 840,
      "position_y": 220,
      "config": {
        "jsCode": "(() => { const buttons = Array.from(document.querySelectorAll('button')); const consent = buttons.find(b => /^(Accetta|Accept|OK|Acconsento|Ho capito)$/i.test((b.innerText || b.textContent || '').trim())); if (consent) consent.click(); return true; })();",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1200,
      "position_y": 220,
      "config": {
        "selector": "div[class*=\"ItemListContainer\"] article[class*=\"adItemCard\"]",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "inject-javascript-2",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Run custom JavaScript on the page",
      "position_x": 1560,
      "position_y": 220,
      "config": {
        "jsCode": "(() => { const buttons = Array.from(document.querySelectorAll('button')).filter(b => /Mostra\\s+numero/i.test((b.innerText || b.textContent || '').trim())); buttons.forEach((button, index) => setTimeout(() => { try { button.scrollIntoView({ block: 'center' }); button.click(); } catch (e) {} }, index * 250)); return buttons.length; })();",
        "waitForCompletion": true,
        "timeout": 15
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1920,
      "position_y": 220,
      "config": {
        "duration": 5
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2280,
      "position_y": 220,
      "config": {
        "rowSelector": "div[class*=\"ItemListContainer\"] article[class*=\"adItemCard\"]",
        "fileName": "scraper-prodotti-subito.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "URL_inserito",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "parola_chiave",
            "selector": "new URL(location.href).searchParams.get('q') || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "categoria",
            "selector": "document.querySelector('ol[itemtype*=\"BreadcrumbList\"] li:nth-child(2) span')?.textContent.trim() || 'Auto'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Titolo",
            "selector": "h3[class*=\"subject\"]",
            "attribute": "text"
          },
          {
            "name": "URL_pagina_annunci",
            "selector": "a[href*=\"/auto/\"][href$=\".htm\"]",
            "attribute": "href"
          },
          {
            "name": "posizione",
            "selector": "[class*=\"location\"]",
            "attribute": "text"
          },
          {
            "name": "prezzo",
            "selector": "[class*=\"priceSection\"] [class*=\"price\"]",
            "attribute": "text"
          },
          {
            "name": "caratteristica1",
            "selector": "(() => { const lines = ROW.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const priceIdx = lines.findIndex(s => /€/.test(s)); const locIdx = lines.findIndex((s, i) => i > priceIdx && /\\([A-Z]{2}\\)/.test(s)); const endIdx = lines.findIndex((s, i) => i > locIdx && /^(Rivenditore|Privato|Mostra\\s+numero)$/i.test(s)); const attrs = lines.slice(locIdx + 1, endIdx > -1 ? endIdx : locIdx + 8).filter(s => !/Mostra\\s+numero/i.test(s)); return attrs[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "caratteristica2",
            "selector": "(() => { const lines = ROW.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const priceIdx = lines.findIndex(s => /€/.test(s)); const locIdx = lines.findIndex((s, i) => i > priceIdx && /\\([A-Z]{2}\\)/.test(s)); const endIdx = lines.findIndex((s, i) => i > locIdx && /^(Rivenditore|Privato|Mostra\\s+numero)$/i.test(s)); const attrs = lines.slice(locIdx + 1, endIdx > -1 ? endIdx : locIdx + 8).filter(s => !/Mostra\\s+numero/i.test(s)); return attrs[1] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "caratteristica3",
            "selector": "(() => { const lines = ROW.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const priceIdx = lines.findIndex(s => /€/.test(s)); const locIdx = lines.findIndex((s, i) => i > priceIdx && /\\([A-Z]{2}\\)/.test(s)); const endIdx = lines.findIndex((s, i) => i > locIdx && /^(Rivenditore|Privato|Mostra\\s+numero)$/i.test(s)); const attrs = lines.slice(locIdx + 1, endIdx > -1 ? endIdx : locIdx + 8).filter(s => !/Mostra\\s+numero/i.test(s)); return attrs[2] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "caratteristica4",
            "selector": "(() => { const lines = ROW.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const priceIdx = lines.findIndex(s => /€/.test(s)); const locIdx = lines.findIndex((s, i) => i > priceIdx && /\\([A-Z]{2}\\)/.test(s)); const endIdx = lines.findIndex((s, i) => i > locIdx && /^(Rivenditore|Privato|Mostra\\s+numero)$/i.test(s)); const attrs = lines.slice(locIdx + 1, endIdx > -1 ? endIdx : locIdx + 8).filter(s => !/Mostra\\s+numero/i.test(s)); return attrs[3] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "caratteristica5",
            "selector": "(() => { const lines = ROW.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const priceIdx = lines.findIndex(s => /€/.test(s)); const locIdx = lines.findIndex((s, i) => i > priceIdx && /\\([A-Z]{2}\\)/.test(s)); const endIdx = lines.findIndex((s, i) => i > locIdx && /^(Rivenditore|Privato|Mostra\\s+numero)$/i.test(s)); const attrs = lines.slice(locIdx + 1, endIdx > -1 ? endIdx : locIdx + 8).filter(s => !/Mostra\\s+numero/i.test(s)); return attrs[4] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "caratteristica6",
            "selector": "(() => { const lines = ROW.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const priceIdx = lines.findIndex(s => /€/.test(s)); const locIdx = lines.findIndex((s, i) => i > priceIdx && /\\([A-Z]{2}\\)/.test(s)); const endIdx = lines.findIndex((s, i) => i > locIdx && /^(Rivenditore|Privato|Mostra\\s+numero)$/i.test(s)); const attrs = lines.slice(locIdx + 1, endIdx > -1 ? endIdx : locIdx + 8).filter(s => !/Mostra\\s+numero/i.test(s)); return attrs[5] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rivenditore",
            "selector": "(() => { const lines = ROW.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const sellerTypeIdx = lines.findIndex(s => /^(Rivenditore|Privato)$/i.test(s)); if (sellerTypeIdx === -1) return ''; const next = lines[sellerTypeIdx + 1] || ''; if (!next || /Mostra\\s+numero/i.test(next)) return lines[sellerTypeIdx]; return next; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "numero_di_telefono",
            "selector": "(() => { const lines = ROW.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const phone = lines.find(s => /(?:\\+39\\s*)?\\d[\\d\\s]{7,}/.test(s) && !/Km|€|\\d{2}\\/\\d{4}/i.test(s)); if (phone) return phone.replace(/\\s+/g, ''); return lines.some(s => /Mostra\\s+numero/i.test(s)) ? 'Mostra numero (non rivelato)' : ''; })()",
            "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": 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": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-1",
      "from_connector_id": "right",
      "to_block_id": "inject-javascript-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-2",
      "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"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 116,
      "width": 2120,
      "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": 768,
      "position_y": 116,
      "width": 1040,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "inject-javascript-1",
          "inject-javascript-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 2208,
      "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": 2568,
      "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 Subito.it listing/search result pages for title, listing URL, location, price, vehicle attributes, dealer name, and best-effort phone number. Pagination is implemented with known Subito o= page URLs from o=1 through o=56 for the sample search URL because the page reports about 1,817 results. Phone extraction attempts to click visible 'Mostra numero' buttons, but Subito may block or limit phone reveal.",
      "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 56 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 320,
      "position_y": 200,
      "width": 332,
      "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 buttons = Array.from(document.querySelectorAll('button')); const consent = buttons.fi...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1040,
      "position_y": 200,
      "width": 340,
      "height": 140,
      "z_index": 22,
      "data": {
        "block_id": "inject-javascript-1"
      }
    },
    {
      "id": "note-block-inject-javascript-2",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(() => { const buttons = Array.from(document.querySelectorAll('button')).filter(b => /Mostra\\s+numer...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 200,
      "width": 340,
      "height": 140,
      "z_index": 22,
      "data": {
        "block_id": "inject-javascript-2"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (URL_inserito, parola_chiave, categoria, caratteristica1, caratteristica2). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 200,
      "width": 340,
      "height": 138,
      "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": 200,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}