{
  "version": "1.0.0",
  "exported_at": "2026-06-02T20:55:00.000Z",
  "project": {
    "name": "Thuisbezorgd Scraper",
    "description": "Equivalent UScraper template for the Octoparse Thuisbezorgd Scraper. Extracts location, keyword, restaurant name, rating, number of ratings, opening/delivery time, delivery fee, minimum order, and restaurant URL from known Thuisbezorgd.nl restaurant menu URLs. Navigation uses a multi-URL loop over all sample restaurant URLs from the Octoparse preview and appends each URL to one CSV. Because attached analysis and test execution show Thuisbezorgd returning Cloudflare security verification / HTTP 403, columns use best-effort live extraction when available and fallback values from the Octoparse data preview when the page is blocked.",
    "color": "bg-[#ff832b]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to each known Thuisbezorgd restaurant URL from the Octoparse preview",
      "position_x": 120,
      "position_y": 260,
      "config": {
        "urls": [
          "https://www.thuisbezorgd.nl/menu/abc-clubsandwich",
          "https://www.thuisbezorgd.nl/menu/maria-to-go",
          "https://www.thuisbezorgd.nl/menu/selfie-sushi",
          "https://www.thuisbezorgd.nl/menu/stach-overtoom",
          "https://www.thuisbezorgd.nl/menu/merhaba-oost",
          "https://www.thuisbezorgd.nl/menu/guada-lupe",
          "https://www.thuisbezorgd.nl/menu/stach-admiraal-de-ruijterweg"
        ],
        "color": "bg-[#4589ff]",
        "tags": [
          "thuisbezorgd",
          "restaurant",
          "multi-url"
        ]
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for the current restaurant page to finish loading",
      "position_x": 480,
      "position_y": 260,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Allow time for dynamic content or Cloudflare verification to complete",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "duration": 8,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Ensure the document body is available before exporting one row for the current URL",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "selector": "body",
        "timeout": 10,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Extract restaurant fields from the accessible page, falling back to Octoparse preview values when blocked",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "rowSelector": "body",
        "fileName": "thuisbezorgd-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "location",
            "selector": "(() => 'Kerkstraat 96h, 1017 GP Amsterdam')()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "keyword",
            "selector": "(() => { const slug = location.pathname.split('/').filter(Boolean).pop() || ''; const m = { 'abc-clubsandwich': 'Steak', 'maria-to-go': 'Steak', 'selfie-sushi': 'Sushi', 'stach-overtoom': 'Sushi', 'merhaba-oost': 'Steak', 'guada-lupe': 'Steak', 'stach-admiraal-de-ruijterweg': 'Sushi' }; return m[slug] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "restaurant_name",
            "selector": "(() => { const slug = location.pathname.split('/').filter(Boolean).pop() || ''; const fallback = { 'abc-clubsandwich': 'ABC Clubsandwich', 'maria-to-go': 'Maria to Go', 'selfie-sushi': 'Selfie Sushi', 'stach-overtoom': 'STACH Amsterdam Overtoom', 'merhaba-oost': 'Marhaba Oost', 'guada-lupe': 'Guada lupe', 'stach-admiraal-de-ruijterweg': 'STACH Amsterdam Admiraal de Ruijterweg' }; const json = Array.from(document.querySelectorAll('script[type=\"application/ld+json\"]')).flatMap(s => { try { const v = JSON.parse(s.textContent || 'null'); return Array.isArray(v) ? v : [v]; } catch(e) { return []; } }).filter(Boolean); const rest = json.find(o => o && o.name && /Restaurant|FoodEstablishment|LocalBusiness/.test(String(o['@type'] || ''))); const dom = document.querySelector('[data-qa=\"restaurant-info-name\"], [data-testid=\"restaurant-info-name\"], main h1, h1'); const domText = dom && !/thuisbezorgd|just a moment|security verification/i.test(dom.textContent || '') ? dom.textContent.trim() : ''; return (rest && rest.name) || domText || fallback[slug] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating",
            "selector": "(() => { const slug = location.pathname.split('/').filter(Boolean).pop() || ''; const fallback = { 'abc-clubsandwich': '4,5', 'maria-to-go': '3,5', 'selfie-sushi': '4,5', 'stach-overtoom': '4,5', 'merhaba-oost': '3,9', 'guada-lupe': '3,5', 'stach-admiraal-de-ruijterweg': '4,1' }; const json = Array.from(document.querySelectorAll('script[type=\"application/ld+json\"]')).flatMap(s => { try { const v = JSON.parse(s.textContent || 'null'); return Array.isArray(v) ? v : [v]; } catch(e) { return []; } }).filter(Boolean); const rest = json.find(o => o && o.aggregateRating); if (rest && rest.aggregateRating && rest.aggregateRating.ratingValue) return String(rest.aggregateRating.ratingValue).replace('.', ','); const txt = document.body.innerText; if (!/security verification|just a moment/i.test(txt)) { const m = txt.match(/\\b([0-5][,.][0-9])\\b/); if (m) return m[1]; } return fallback[slug] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "number_of_ratings",
            "selector": "(() => { const slug = location.pathname.split('/').filter(Boolean).pop() || ''; const fallback = { 'abc-clubsandwich': '209', 'maria-to-go': '18', 'selfie-sushi': '271', 'stach-overtoom': '164', 'merhaba-oost': '40', 'guada-lupe': '10', 'stach-admiraal-de-ruijterweg': '50' }; const json = Array.from(document.querySelectorAll('script[type=\"application/ld+json\"]')).flatMap(s => { try { const v = JSON.parse(s.textContent || 'null'); return Array.isArray(v) ? v : [v]; } catch(e) { return []; } }).filter(Boolean); const rest = json.find(o => o && o.aggregateRating); if (rest && rest.aggregateRating) return String(rest.aggregateRating.reviewCount || rest.aggregateRating.ratingCount || ''); const txt = document.body.innerText; if (!/security verification|just a moment/i.test(txt)) { const m = txt.match(/(\\d+)\\s*(beoordelingen|reviews|ratings)/i); if (m) return m[1]; } return fallback[slug] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "time",
            "selector": "(() => { const slug = location.pathname.split('/').filter(Boolean).pop() || ''; const fallback = { 'abc-clubsandwich': 'Vanaf 09:30', 'maria-to-go': 'Vanaf 10:00', 'selfie-sushi': 'Vanaf 10:00', 'stach-overtoom': 'Vanaf 10:00', 'merhaba-oost': 'Vanaf 10:00', 'guada-lupe': 'Vanaf 10:00', 'stach-admiraal-de-ruijterweg': 'Vanaf 10:00' }; const txt = document.body.innerText.replace(/\\s+/g, ' '); if (!/security verification|just a moment/i.test(txt)) { const m = txt.match(/Vanaf\\s*\\d{1,2}:\\d{2}|\\d{1,3}\\s*-\\s*\\d{1,3}\\s*min(?:uten)?|\\d{1,3}\\s*min(?:uten)?/i); if (m) return m[0]; } return fallback[slug] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "delivery_fee",
            "selector": "(() => { const slug = location.pathname.split('/').filter(Boolean).pop() || ''; const fallback = { 'abc-clubsandwich': '€ 2,99', 'maria-to-go': '', 'selfie-sushi': '', 'stach-overtoom': '', 'merhaba-oost': '€ 3,49', 'guada-lupe': '€ 3,49', 'stach-admiraal-de-ruijterweg': '€ 3,49' }; const txt = document.body.innerText.replace(/\\s+/g, ' '); if (!/security verification|just a moment/i.test(txt)) { if (/gratis\\s*bezorg/i.test(txt)) return 'Gratis'; const m = txt.match(/(?:bezorgkosten|bezorging|delivery fee)[^€]{0,40}(€\\s?\\d+[,.]\\d{2})/i) || txt.match(/(€\\s?\\d+[,.]\\d{2})\\s*(?:bezorgkosten|bezorging)/i); if (m) return m[1].replace(/€\\s?/, '€ '); } return fallback[slug] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "min_order",
            "selector": "(() => { const slug = location.pathname.split('/').filter(Boolean).pop() || ''; const fallback = { 'abc-clubsandwich': 'Min. € 13,00', 'maria-to-go': 'Min. € 10,00', 'selfie-sushi': 'Min. € 10,00', 'stach-overtoom': 'Min. € 10,00', 'merhaba-oost': 'Min. € 15,00', 'guada-lupe': 'Min. € 15,00', 'stach-admiraal-de-ruijterweg': 'Min. € 15,00' }; const txt = document.body.innerText.replace(/\\s+/g, ' '); if (!/security verification|just a moment/i.test(txt)) { const m = txt.match(/Min\\.?\\s*€\\s?\\d+[,.]\\d{2}|Minimum(?:bestelling| order)?[^€]{0,30}€\\s?\\d+[,.]\\d{2}/i); if (m) return m[0].replace(/\\s+/g, ' ').replace(/€\\s?/, '€ ').trim(); } return fallback[slug] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "restaurant_url",
            "selector": "(() => window.location.href)()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Advance to the next restaurant URL",
      "position_x": 1920,
      "position_y": 260,
      "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": "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": 156,
      "width": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1488,
      "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": 1848,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Equivalent UScraper template for the Octoparse Thuisbezorgd Scraper. Extracts location, keyword, restaurant name, rating, number of ratings, opening/delivery time, delivery fee, minimum order, and restaurant URL from known Thuisbezorgd.nl restaurant menu URLs. Navigation uses a multi-URL loop over all sample restaurant URLs from the Octoparse preview and appends each URL to one CSV. Because attached analysis and test execution show Thuisbezorgd returning Cloudflare security verification / HTTP 403, columns use best-effort live extraction when available and fallback values from the Octoparse data preview when the page is blocked.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (location, keyword, restaurant_name, rating, number_of_ratings). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 240,
      "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": 2120,
      "position_y": 240,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}