{
  "version": "1.0.0",
  "exported_at": "2026-06-03T08:45:00.000Z",
  "project": {
    "name": "Just Eat Restaurant Listing Scraper - Italian",
    "description": "Best-effort UScraper equivalent of the Octoparse Just Eat restaurant listing template. Scrapes restaurant listing-style fields from supplied Just Eat UK restaurant menu URLs: location, restaurant name, rating, rating count, tags/cuisine, delivery time, delivery fee, minimum order, discounts, and restaurant URL. Navigation uses a multi-URL loop over restaurant pages with append mode. A menu-page guard skips URLs that redirect to the Just Eat homepage or otherwise do not expose a restaurant menu. Some listing-specific fields may be blank if they are not exposed on the menu page or require postcode/session context.",
    "color": "bg-[#ff8000]",
    "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.just-eat.co.uk/restaurants-regina-pizza-new-croydon-cr0/menu",
          "https://www.just-eat.co.uk/restaurants-taste-of-china-streatham-common/menu",
          "https://www.just-eat.co.uk/restaurants-iro-sushi-purley/menu"
        ],
        "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": 456,
      "position_y": 220,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 792,
      "position_y": 220,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "duration": 3
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1464,
      "position_y": 220,
      "config": {
        "selector": "[data-qa=\"menu-list\"]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1800,
      "position_y": 520,
      "config": {
        "rowSelector": "body",
        "fileName": "just-eat-restaurant-listing-scraper-italian.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "location",
            "selector": "(() => { const norm = s => (s || '').replace(/\\s+/g, ' ').trim(); const meta = document.querySelector('meta[name=\"description\"]')?.content || ''; const title = document.title || ''; const m1 = meta.match(/\\bin\\s+([^\\.]+?\\s+[A-Z]{1,2}\\d[A-Z\\d]?\\s*\\d[A-Z]{2})\\b/i); if (m1) return norm(m1[1]); const m2 = title.match(/restaurant menu in\\s+(.+?)\\s+-\\s+Order/i); if (m2) return norm(m2[1]); const text = document.body?.innerText || ''; const postcode = text.match(/\\b[A-Z]{1,2}\\d[A-Z\\d]?\\s*\\d[A-Z]{2}\\b/i); return postcode ? norm(postcode[0]) : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "restaurant_name",
            "selector": "(() => { const norm = s => (s || '').replace(/\\s+/g, ' ').trim(); const h1 = document.querySelector('h1')?.textContent || ''; if (h1 && !/order food and more/i.test(h1)) return norm(h1); return norm((document.title || '').replace(/ restaurant menu.*$/i, '')); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating",
            "selector": "(() => { const norm = s => (s || '').replace(/\\s+/g, ' ').trim(); const aria = Array.from(document.querySelectorAll('[aria-label]')).map(e => e.getAttribute('aria-label') || '').join(' '); const text = document.body?.innerText || ''; const combined = norm(`${aria} ${text}`); const m = combined.match(/\\b(\\d(?:\\.\\d{1,2})?)\\s+stars?\\b\\s+out\\s+of\\s+5\\b/i) || combined.match(/\\brated\\s+(\\d(?:\\.\\d{1,2})?)\\s+out\\s+of\\s+5\\b/i); return m ? `${m[1]} stars out of 5` : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "number_of_ratings",
            "selector": "(() => { const norm = s => (s || '').replace(/\\s+/g, ' ').trim(); const aria = Array.from(document.querySelectorAll('[aria-label]')).map(e => e.getAttribute('aria-label') || '').join(' '); const text = document.body?.innerText || ''; const combined = norm(`${aria} ${text}`); const m = combined.match(/\\b(\\d[\\d,]*)\\s+(?:ratings?|reviews?)\\b/i) || combined.match(/\\bratings?\\s*\\(?\\s*(\\d[\\d,]*)\\s*\\)?/i); return m ? m[1].replace(/,/g, '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "tags",
            "selector": "(() => { const norm = s => (s || '').replace(/\\s+/g, ' ').trim(); const meta = document.querySelector('meta[name=\"description\"]')?.content || ''; const cuisine = meta.match(/Wide selection of\\s+(.+?)\\s+to have delivered/i); if (cuisine) return norm(cuisine[1]); const headings = Array.from(document.querySelectorAll('[data-qa=\"menu-list\"] h2')).map(h => norm(h.textContent)).filter(Boolean); return headings.filter(h => !/basket|fill your basket|welcome back|highlights/i.test(h)).slice(0, 4).join(' '); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "deliver_time",
            "selector": "(() => { const text = (document.body?.innerText || '').replace(/\\s+/g, ' '); const m = text.match(/\\b\\d{2}\\s*-\\s*\\d{2}\\s*mins\\b/i) || text.match(/\\b\\d+\\s*-\\s*\\d+\\s*min(?:ute)?s?\\b/i); return m ? m[0].replace(/\\s+/g, ' ').trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "delivery_fee",
            "selector": "(() => { const text = (document.body?.innerText || '').replace(/\\s+/g, ' '); const m = text.match(/Delivery\\s+(?:from\\s+)?(?:FREE|£\\d+(?:\\.\\d{2})?)/i) || text.match(/Free delivery/i); return m ? m[0].replace(/\\s+/g, ' ').trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "min_order",
            "selector": "(() => { const text = (document.body?.innerText || '').replace(/\\s+/g, ' '); const m = text.match(/Min\\.\\s*order\\s*£?\\d+(?:\\.\\d{2})?/i) || text.match(/No\\s+min\\.\\s*order/i); return m ? m[0].replace(/\\s+/g, ' ').trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "discounts",
            "selector": "(() => { const text = (document.body?.innerText || '').replace(/\\s+/g, ' '); const patterns = [/\\d+%\\s+off\\s+when\\s+you\\s+spend\\s+£?\\d+(?:\\.\\d{2})?/i, /Free item with selected orders/i, /Collect stamps/i, /Low Delivery Fee/i]; for (const p of patterns) { const m = text.match(p); if (m) return m[0].replace(/\\s+/g, ' ').trim(); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "restaurant_url",
            "selector": "(() => { return location.pathname.includes('/restaurants-') ? location.origin + location.pathname : ''; })()",
            "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": 520,
      "config": {}
    },
    {
      "block_id": "loop-continue-2",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 1464,
      "position_y": 520,
      "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": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-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": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "true",
      "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"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "loop-continue-2",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 116,
      "width": 1328,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1392,
      "position_y": 116,
      "width": 992,
      "height": 596,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "loop-continue-1",
          "loop-continue-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1728,
      "position_y": 416,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort UScraper equivalent of the Octoparse Just Eat restaurant listing template. Scrapes restaurant listing-style fields from supplied Just Eat UK restaurant menu URLs: location, restaurant name, rating, rating count, tags/cuisine, delivery time, delivery fee, minimum order, discounts, and restaurant URL. Navigation uses a multi-URL loop over restaurant pages with append mode. A menu-page guard skips URLs that redirect to the Just Eat homepage or otherwise do not expose a restaurant menu. Some listing-specific fields may be blank if they are not exposed on the menu page or require postcode/session context.",
      "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 3 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-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `[data-qa=\"menu-list\"]`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1664,
      "position_y": 200,
      "width": 340,
      "height": 137,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (location, restaurant_name, rating, number_of_ratings, tags). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2000,
      "position_y": 500,
      "width": 340,
      "height": 133,
      "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": 500,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    },
    {
      "id": "note-block-loop-continue-2",
      "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": 1664,
      "position_y": 500,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-2"
      }
    }
  ]
}