{
  "version": "1.0.0",
  "exported_at": "2026-06-02T14:30:00.000Z",
  "project": {
    "name": "Bienici Data Scraper",
    "description": "Extracts Bien’ici real-estate listing data equivalent to the Octoparse Bien'ici template: property type/title, rooms, surface, address, price, price terms, detail URL, description/snippet, and photo URL. Navigation is implemented as a multi-URL input loop using the analyzed Bien’ici listing URLs; results are appended to one CSV. The attached analyses showed no next-page pagination for these locations, so all visible cards on each input URL are scraped.",
    "color": "bg-[#42be65]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 120,
      "position_y": 240,
      "config": {
        "urls": [
          "https://www.bienici.com/recherche/location/la-tronche-38700/appartement",
          "https://www.bienici.com/recherche/location/le-versoud-38420/appartement"
        ],
        "color": "bg-[#4589ff]",
        "tags": [
          "bienici",
          "multi-url",
          "real-estate"
        ]
      }
    },
    {
      "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": 240,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 840,
      "position_y": 240,
      "config": {
        "jsCode": "(() => {\n  const candidates = Array.from(document.querySelectorAll('button, a, [role=\"button\"]'));\n  const btn = candidates.find(el => /^(ACCEPTER|Continuer sans accepter)/i.test((el.textContent || '').trim()));\n  if (btn) btn.click();\n  return btn ? 'cookie banner dismissed' : 'no cookie banner action needed';\n})()",
        "waitForCompletion": true,
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "duration": 2,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1560,
      "position_y": 240,
      "config": {
        "selector": "a.detailedSheetLink",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 240,
      "config": {
        "rowSelector": "a.detailedSheetLink",
        "fileName": "bien-ici-data-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "type_de_logement",
            "selector": ".real-estate-main-info__title",
            "attribute": "text"
          },
          {
            "name": "pieces",
            "selector": "(() => { const title = ROW.querySelector('.real-estate-main-info__title')?.textContent || ''; const m = title.match(/\\d+\\s*pi[eè]ces?/i); return m ? m[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "espace",
            "selector": "(() => { const title = ROW.querySelector('.real-estate-main-info__title')?.textContent || ROW.textContent || ''; const m = title.match(/\\d+(?:[,.]\\d+)?\\s*m²/i); return m ? m[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "adresse",
            "selector": ".real-estate-main-info__address",
            "attribute": "text"
          },
          {
            "name": "prix_1",
            "selector": "(() => { const text = (ROW.querySelector('[class*=\"price\" i]')?.textContent || ROW.textContent || '').replace(/\\s+/g, ' ').trim(); const m = text.match(/\\d[\\d\\s.,]*\\s*€/); return m ? m[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "prix_2",
            "selector": "(() => { const text = (ROW.querySelector('[class*=\"price\" i]')?.textContent || ROW.textContent || '').replace(/\\s+/g, ' ').trim(); const m = text.match(/€\\s*(par\\s+mois[^\\dA-ZÀ-Ÿ]*)/i); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "url_du_page_detaille",
            "selector": "",
            "attribute": "href"
          },
          {
            "name": "description",
            "selector": "(() => { const clone = ROW.cloneNode(true); clone.querySelectorAll('script, style, img, svg').forEach(e => e.remove()); const title = ROW.querySelector('.real-estate-main-info__title')?.textContent?.trim() || ''; const addr = ROW.querySelector('.real-estate-main-info__address')?.textContent?.trim() || ''; let text = (clone.textContent || '').replace(/\\s+/g, ' ').trim(); if (title) text = text.replace(title, ' '); if (addr) text = text.replace(addr, ' '); text = text.replace(/^\\d+\\s*/, ' ').replace(/Coup\\s+de\\s+de\\s+l[’']agence/i, ' '); const priceMatch = text.match(/\\d[\\d\\s.,]*\\s*€/); if (priceMatch) { const idx = text.indexOf(priceMatch[0]); const after = text.slice(idx + priceMatch[0].length).trim(); const charge = after.match(/^(par\\s+mois[^A-ZÀ-Ÿ]*)/i); text = charge ? after.slice(charge[0].length).trim() : after; } return text.replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "photo_url",
            "selector": "(() => { const img = ROW.querySelector('img.img__image, img'); return img ? (img.currentSrc || img.src || img.getAttribute('data-src') || img.getAttribute('src') || '') : ''; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2280,
      "position_y": 240,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "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": 136,
      "width": 1760,
      "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": 768,
      "position_y": 136,
      "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": 1848,
      "position_y": 136,
      "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": 2208,
      "position_y": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Extracts Bien’ici real-estate listing data equivalent to the Octoparse Bien'ici template: property type/title, rooms, surface, address, price, price terms, detail URL, description/snippet, and photo URL. Navigation is implemented as a multi-URL input loop using the analyzed Bien’ici listing URLs; results are appended to one CSV. The attached analyses showed no next-page pagination for these locations, so all visible cards on each input URL are scraped.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-inject-javascript-1",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(() => {\n  const candidates = Array.from(document.querySelectorAll('button, a, [role=\"button\"]'));\n ...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1040,
      "position_y": 220,
      "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 (pieces, espace, prix_1, prix_2, description). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 220,
      "width": 340,
      "height": 128,
      "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": 2480,
      "position_y": 220,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}