{
  "version": "1.0.0",
  "exported_at": "2026-06-01T16:35:00.000Z",
  "project": {
    "name": "Just Eat Restaurant Listing Scraper",
    "description": "Extracts Just Eat UK restaurant listing-style information from known restaurant menu URLs: location, restaurant name, rating, number of ratings, tags/cuisines, delivery time, delivery fee, minimum order, discounts, and restaurant URL. Navigation uses a multi-URL loop over provided Just Eat restaurant menu URLs and appends one row per valid restaurant page. A guard checks for Just Eat menu content and skips URLs that redirect to the homepage or other non-menu pages. Rating and review-count fields are best-effort because the attached analysis is for menu/detail pages rather than postcode listing cards.",
    "color": "bg-[#ff8000]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Set browser window dimensions",
      "position_x": 120,
      "position_y": 260,
      "config": {
        "width": 1920,
        "height": 1080,
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 480,
      "position_y": 260,
      "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-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "selector": "h1",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "duration": 3,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1920,
      "position_y": 260,
      "config": {
        "selector": "[data-qa=\"menu-list\"]",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2280,
      "position_y": 260,
      "config": {
        "rowSelector": "body",
        "fileName": "just_eat_restaurant_listing_scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "location",
            "selector": "(() => { const meta = document.querySelector('meta[name=\"description\"]')?.content || ''; const m = meta.match(/\\bin\\s+(.+?)\\s+and place/i); if (m) return m[1].trim().replace(/\\s+/g, ' '); const txt = ROW.innerText || ''; const pc = txt.match(/[A-Z]{1,2}\\d[A-Z\\d]?\\s*\\d[A-Z]{2}/i); return pc ? pc[0].toUpperCase().replace(/\\s+/g, ' ') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "restaurant_name",
            "selector": "(() => ((ROW.querySelector('h1')?.textContent || '').trim().replace(/\\s+/g, ' ')))()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating",
            "selector": "(() => { const text = [ROW.innerText || '', ...Array.from(document.querySelectorAll('[aria-label]')).map(e => e.getAttribute('aria-label') || ''), ...Array.from(document.scripts).map(s => s.textContent || '')].join(' '); const jsonMatch = text.match(/\"(?:ratingValue|averageRating|starRating)\"\\s*:\\s*\"?(\\d+(?:\\.\\d+)?)\"?/i); if (jsonMatch) return jsonMatch[1] + ' stars out of 5'; const m = text.match(/(\\d+(?:\\.\\d+)?)\\s*stars?\\s*out\\s*of\\s*5/i) || text.match(/Rated\\s+(\\d+(?:\\.\\d+)?)\\s*out\\s*of\\s*5/i); return m ? (m[1] ? m[1] + ' stars out of 5' : m[0].replace(/^Rated\\s+/i, '').replace(/\\s+/g, ' ').trim()) : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "number_of_ratings",
            "selector": "(() => { const text = [ROW.innerText || '', ...Array.from(document.querySelectorAll('[aria-label]')).map(e => e.getAttribute('aria-label') || ''), ...Array.from(document.scripts).map(s => s.textContent || '')].join(' '); const jsonMatch = text.match(/\"(?:reviewCount|ratingCount|numberOfRatings|ratingsCount|reviewsCount)\"\\s*:\\s*\"?([\\d,]+)\"?/i); if (jsonMatch) return jsonMatch[1].replace(/,/g, ''); const m = text.match(/([\\d,]+)\\s*(?:ratings?|reviews?)/i); return m ? m[1].replace(/,/g, '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "tags",
            "selector": "(() => { const meta = document.querySelector('meta[name=\"description\"]')?.content || ''; const cuisine = (meta.match(/Wide selection of\\s+(.+?)\\s+to have/i) || [])[1] || ''; return cuisine.trim().replace(/\\s+/g, ' '); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "deliver_time",
            "selector": "(() => { const text = [ROW.innerText || '', ...Array.from(document.scripts).map(s => s.textContent || '')].join(' ').replace(/\\s+/g, ' '); const m = text.match(/\\b\\d+\\s*-\\s*\\d+\\s*mins\\b/i) || text.match(/\\b\\d+\\s*mins\\b/i); return m ? m[0].replace(/\\s+/g, ' ').trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "delivery_fee",
            "selector": "(() => { const text = (ROW.innerText || '').replace(/\\s+/g, ' '); const m = text.match(/Delivery\\s+(?:from\\s+)?(?:FREE|£\\d+(?:\\.\\d{2})?)/i); return m ? m[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "min_order",
            "selector": "(() => { const text = (ROW.innerText || '').replace(/\\s+/g, ' '); const m = text.match(/No\\s+min\\.\\s*order/i) || text.match(/Min\\.\\s*order\\s*£\\d+(?:\\.\\d{2})?/i); return m ? m[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "discounts",
            "selector": "(() => { const text = (ROW.innerText || '').replace(/\\s+/g, ' '); const patterns = [/\\d+%\\s+off\\s+when\\s+you\\s+spend\\s+£\\d+(?:\\.\\d{2})?/i, /Free\\s+item\\s+with\\s+selected\\s+orders/i, /\\d+%\\s+off/i, /Free\\s+delivery/i]; for (const p of patterns) { const m = text.match(p); if (m) return m[0].trim(); } return ''; })()",
            "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": "Continue multi-input loop",
      "position_x": 2640,
      "position_y": 580,
      "config": {
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "loop-continue-2",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 1920,
      "position_y": 580,
      "config": {
        "color": "bg-[#ff832b]"
      }
    }
  ],
  "connections": [
    {
      "from_block_id": "set-window-size-1",
      "from_connector_id": "right",
      "to_block_id": "navigate-1",
      "to_connector_id": "left"
    },
    {
      "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-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 48,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "set-window-size-1"
        ]
      }
    },
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 408,
      "position_y": 156,
      "width": 1400,
      "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": 1848,
      "position_y": 156,
      "width": 1040,
      "height": 616,
      "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": 2208,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Extracts Just Eat UK restaurant listing-style information from known restaurant menu URLs: location, restaurant name, rating, number of ratings, tags/cuisines, delivery time, delivery fee, minimum order, discounts, and restaurant URL. Navigation uses a multi-URL loop over provided Just Eat restaurant menu URLs and appends one row per valid restaurant page. A guard checks for Just Eat menu content and skips URLs that redirect to the homepage or other non-menu pages. Rating and review-count fields are best-effort because the attached analysis is for menu/detail pages rather than postcode listing cards.",
      "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": 680,
      "position_y": 240,
      "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": 2120,
      "position_y": 240,
      "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": 2480,
      "position_y": 240,
      "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": 2840,
      "position_y": 560,
      "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": 2120,
      "position_y": 560,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-2"
      }
    }
  ]
}