{
  "version": "1.0.0",
  "exported_at": "2026-06-03T00:00:00.000Z",
  "project": {
    "name": "Galliver Fnrima Used Car Sales Scraper",
    "description": "Best-effort UScraper equivalent of the deprecated Octoparse Gulliver/Galliver Frima used car sales template. It targets Gulliver's Japanese used-car listings, starting from https://221616.com/search/toyota/ as a populated keyword/category listing, and extracts vehicle name, price, year, mileage, inspection/shaken, repair history, store/location, detail URL, and image URL. Because no Page Analysis JSON was provided and the first generic /search/ page did not expose matching rows, this version injects JavaScript to mark likely vehicle cards and next-page links with data-uscraper attributes before extraction. Pagination uses a click-next loop and appends all pages to one CSV.",
    "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": 260,
      "config": {
        "url": "https://221616.com/search/toyota/",
        "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": 260,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "jsCode": "(function(){\n  document.querySelectorAll('[data-uscraper-row], [data-uscraper-next]').forEach(function(el){\n    el.removeAttribute('data-uscraper-row');\n    el.removeAttribute('data-uscraper-next');\n  });\n\n  function textOf(el){\n    return (el && (el.innerText || el.textContent) || '').replace(/\\s+/g, ' ').trim();\n  }\n\n  function visible(el){\n    if (!el) return false;\n    var rect = el.getBoundingClientRect();\n    var style = window.getComputedStyle(el);\n    return rect.width > 0 && rect.height > 0 && style.display !== 'none' && style.visibility !== 'hidden';\n  }\n\n  var containers = new Set();\n\n  Array.from(document.querySelectorAll('a[href]')).forEach(function(a){\n    var href = a.href || '';\n    var txt = textOf(a);\n    var looksLikeVehicleLink = /detail|stock|used|ucar|car|search\\//i.test(href) || /詳細|在庫|見積|お問い合わせ|車両/.test(txt);\n    if (!looksLikeVehicleLink) return;\n    var row = a.closest('article, li, section, [class*=\"card\"], [class*=\"Card\"], [class*=\"item\"], [class*=\"Item\"], [class*=\"stock\"], [class*=\"Stock\"], [class*=\"car\"], [class*=\"Car\"]') || a.parentElement;\n    if (row && row !== document.body && row !== document.documentElement) containers.add(row);\n  });\n\n  Array.from(document.querySelectorAll('article, li, section, div')).forEach(function(el){\n    if (!visible(el)) return;\n    var t = textOf(el);\n    if (t.length < 35 || t.length > 3500) return;\n    var hasVehicleFacts = /万円/.test(t) && /(年式|初度登録|走行|車検|検査|修復歴|km|Ｋｍ|店舗|販売店|排気|車両|支払総額|本体価格)/.test(t);\n    if (hasVehicleFacts) containers.add(el);\n  });\n\n  var arr = Array.from(containers).filter(function(el){ return visible(el); });\n  var leafRows = arr.filter(function(el){\n    return !arr.some(function(other){\n      return other !== el && el.contains(other) && textOf(other).length >= 35;\n    });\n  });\n\n  leafRows.slice(0, 120).forEach(function(el, idx){\n    el.setAttribute('data-uscraper-row', 'car');\n    el.setAttribute('data-uscraper-row-index', String(idx + 1));\n  });\n\n  var nextLinks = Array.from(document.querySelectorAll('a[href], button')).filter(function(el){\n    if (!visible(el)) return false;\n    var t = textOf(el);\n    var cls = el.getAttribute('class') || '';\n    var rel = el.getAttribute('rel') || '';\n    var aria = el.getAttribute('aria-label') || '';\n    var disabled = el.getAttribute('aria-disabled') === 'true' || el.disabled || /disabled|disable|inactive|current/.test(cls);\n    if (disabled) return false;\n    return /next/i.test(rel) || /next/i.test(cls) || /next/i.test(aria) || /次|次へ|›|＞|>/.test(t + ' ' + aria);\n  });\n\n  if (nextLinks.length) {\n    nextLinks[0].setAttribute('data-uscraper-next', 'true');\n  }\n\n  return { rowsMarked: leafRows.length, nextMarked: nextLinks.length };\n})();",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "selector": "[data-uscraper-row=\"car\"]",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 260,
      "config": {
        "rowSelector": "[data-uscraper-row=\"car\"]",
        "fileName": "galliverfrima-used-car-sales-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "vehicle_name",
            "selector": "(function(){ const clean=s=>(s||'').replace(/\\s+/g,' ').trim(); const sels=['h1','h2','h3','h4','[class*=\"title\"]','[class*=\"Title\"]','[class*=\"name\"]','[class*=\"Name\"]','a[href]']; for (const s of sels){ const el=ROW.querySelector(s); const v=clean(el && el.textContent); if(v && !/詳細|見積|お問い合わせ|次へ/.test(v)) return v; } const lines=(ROW.innerText||'').split(/\\n+/).map(clean).filter(Boolean); return lines[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": "(function(){ const t=(ROW.innerText||'').replace(/\\s+/g,' '); let m=t.match(/(?:支払総額|本体価格|車両価格|価格)[^0-9０-９]*(\\d+(?:\\.\\d+)?\\s*万円)/); if(m) return m[1].replace(/\\s+/g,''); m=t.match(/\\d+(?:\\.\\d+)?\\s*万円/); return m ? m[0].replace(/\\s+/g,'') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "model_year",
            "selector": "(function(){ const t=(ROW.innerText||'').replace(/\\s+/g,' '); let m=t.match(/(?:年式|初度登録|モデル年)[：:\\s]*([^\\s|／/]{2,16})/); if(m) return m[1]; m=t.match(/(20\\d{2}|19\\d{2}|令和\\s*\\d+|平成\\s*\\d+)年?/); return m ? m[0].replace(/\\s+/g,'') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "mileage",
            "selector": "(function(){ const t=(ROW.innerText||'').replace(/\\s+/g,' '); let m=t.match(/(?:走行距離|走行)[：:\\s]*([0-9０-９]+(?:\\.[0-9０-９]+)?\\s*(?:万)?\\s*(?:km|Ｋｍ|㎞|キロ))/i); if(m) return m[1].replace(/\\s+/g,''); m=t.match(/[0-9０-９]+(?:\\.[0-9０-９]+)?\\s*(?:万)?\\s*(?:km|Ｋｍ|㎞|キロ)/i); return m ? m[0].replace(/\\s+/g,'') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "inspection",
            "selector": "(function(){ const clean=s=>(s||'').replace(/\\s+/g,' ').trim(); const lines=(ROW.innerText||'').split(/\\n+/).map(clean).filter(Boolean); const hit=lines.find(s=>/車検|検査/.test(s)); return hit ? hit.replace(/^.*?(車検|検査)[：:\\s]*/,'').trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "repair_history",
            "selector": "(function(){ const t=(ROW.innerText||'').replace(/\\s+/g,' '); const m=t.match(/修復歴[：:\\s]*(なし|無し|無|あり|有|不明)/); return m ? m[1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "location_or_store",
            "selector": "(function(){ const clean=s=>(s||'').replace(/\\s+/g,' ').trim(); const lines=(ROW.innerText||'').split(/\\n+/).map(clean).filter(Boolean); const hit=lines.find(s=>/(販売店|店舗|所在地|地域|北海道|東京都|大阪府|京都府|神奈川県|埼玉県|千葉県|愛知県|福岡県|県)/.test(s)); return hit ? hit.replace(/^(販売店|店舗|所在地|地域)[：:\\s]*/,'') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "detail_url",
            "selector": "(function(){ const links=Array.from(ROW.querySelectorAll('a[href]')); const a=links.find(x=>/detail|stock|used|ucar|search\\//i.test(x.href)) || links[0]; return a ? a.href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url",
            "selector": "(function(){ const img=ROW.querySelector('img[src], img[data-src], source[srcset]'); if(!img) return ''; return img.getAttribute('src') || img.getAttribute('data-src') || img.getAttribute('srcset') || ''; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 2280,
      "position_y": 260,
      "config": {
        "selector": "[data-uscraper-next=\"true\"]"
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 2280,
      "position_y": 620,
      "config": {}
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 2640,
      "position_y": 620,
      "config": {
        "selector": "[data-uscraper-next=\"true\"]",
        "timeout": 10
      }
    },
    {
      "block_id": "wait-for-page-load-2",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 3000,
      "position_y": 620,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 3360,
      "position_y": 620,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "inject-javascript-2",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 3720,
      "position_y": 620,
      "config": {
        "jsCode": "(function(){\n  document.querySelectorAll('[data-uscraper-row], [data-uscraper-next]').forEach(function(el){\n    el.removeAttribute('data-uscraper-row');\n    el.removeAttribute('data-uscraper-next');\n  });\n\n  function textOf(el){\n    return (el && (el.innerText || el.textContent) || '').replace(/\\s+/g, ' ').trim();\n  }\n\n  function visible(el){\n    if (!el) return false;\n    var rect = el.getBoundingClientRect();\n    var style = window.getComputedStyle(el);\n    return rect.width > 0 && rect.height > 0 && style.display !== 'none' && style.visibility !== 'hidden';\n  }\n\n  var containers = new Set();\n\n  Array.from(document.querySelectorAll('a[href]')).forEach(function(a){\n    var href = a.href || '';\n    var txt = textOf(a);\n    var looksLikeVehicleLink = /detail|stock|used|ucar|car|search\\//i.test(href) || /詳細|在庫|見積|お問い合わせ|車両/.test(txt);\n    if (!looksLikeVehicleLink) return;\n    var row = a.closest('article, li, section, [class*=\"card\"], [class*=\"Card\"], [class*=\"item\"], [class*=\"Item\"], [class*=\"stock\"], [class*=\"Stock\"], [class*=\"car\"], [class*=\"Car\"]') || a.parentElement;\n    if (row && row !== document.body && row !== document.documentElement) containers.add(row);\n  });\n\n  Array.from(document.querySelectorAll('article, li, section, div')).forEach(function(el){\n    if (!visible(el)) return;\n    var t = textOf(el);\n    if (t.length < 35 || t.length > 3500) return;\n    var hasVehicleFacts = /万円/.test(t) && /(年式|初度登録|走行|車検|検査|修復歴|km|Ｋｍ|店舗|販売店|排気|車両|支払総額|本体価格)/.test(t);\n    if (hasVehicleFacts) containers.add(el);\n  });\n\n  var arr = Array.from(containers).filter(function(el){ return visible(el); });\n  var leafRows = arr.filter(function(el){\n    return !arr.some(function(other){\n      return other !== el && el.contains(other) && textOf(other).length >= 35;\n    });\n  });\n\n  leafRows.slice(0, 120).forEach(function(el, idx){\n    el.setAttribute('data-uscraper-row', 'car');\n    el.setAttribute('data-uscraper-row-index', String(idx + 1));\n  });\n\n  var nextLinks = Array.from(document.querySelectorAll('a[href], button')).filter(function(el){\n    if (!visible(el)) return false;\n    var t = textOf(el);\n    var cls = el.getAttribute('class') || '';\n    var rel = el.getAttribute('rel') || '';\n    var aria = el.getAttribute('aria-label') || '';\n    var disabled = el.getAttribute('aria-disabled') === 'true' || el.disabled || /disabled|disable|inactive|current/.test(cls);\n    if (disabled) return false;\n    return /next/i.test(rel) || /next/i.test(cls) || /next/i.test(aria) || /次|次へ|›|＞|>/.test(t + ' ' + aria);\n  });\n\n  if (nextLinks.length) {\n    nextLinks[0].setAttribute('data-uscraper-next', 'true');\n  }\n\n  return { rowsMarked: leafRows.length, nextMarked: nextLinks.length };\n})();",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 4080,
      "position_y": 620,
      "config": {
        "selector": "[data-uscraper-row=\"car\"]",
        "timeout": 30,
        "visible": true
      }
    }
  ],
  "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": "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": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "end-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "true",
      "to_block_id": "click-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-page-load-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-page-load-2",
      "from_connector_id": "right",
      "to_block_id": "sleep-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-2",
      "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": "wait-for-element-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-2",
      "from_connector_id": "right",
      "to_block_id": "structured-export-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": 4280,
      "height": 656,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1",
          "wait-for-page-load-2",
          "sleep-2",
          "wait-for-element-2"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1128,
      "position_y": 156,
      "width": 2840,
      "height": 656,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "inject-javascript-1",
          "inject-javascript-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "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": 2208,
      "position_y": 156,
      "width": 680,
      "height": 656,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 2208,
      "position_y": 516,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort UScraper equivalent of the deprecated Octoparse Gulliver/Galliver Frima used car sales template. It targets Gulliver's Japanese used-car listings, starting from https://221616.com/search/toyota/ as a populated keyword/category listing, and extracts vehicle name, price, year, mileage, inspection/shaken, repair history, store/location, detail URL, and image URL. Because no Page Analysis JSON was provided and the first generic /search/ page did not expose matching rows, this version injects JavaScript to mark likely vehicle cards and next-page links with data-uscraper attributes before extraction. Pagination uses a click-next loop and appends all pages to one CSV.",
      "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: `(function(){\n  document.querySelectorAll('[data-uscraper-row], [data-uscraper-next]').forEach(functi...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1400,
      "position_y": 240,
      "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 (vehicle_name, price, model_year, mileage, inspection). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 240,
      "width": 340,
      "height": 131,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `[data-uscraper-next=\"true\"]`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 240,
      "width": 340,
      "height": 139,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-click-1",
      "element_type": "note",
      "title": "Note: Click",
      "content": "Pagination click — add waits after this block; the page reloads asynchronously.",
      "color": "#ee5396",
      "position_x": 2840,
      "position_y": 600,
      "width": 316,
      "height": 106,
      "z_index": 22,
      "data": {
        "block_id": "click-1"
      }
    },
    {
      "id": "note-block-inject-javascript-2",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(function(){\n  document.querySelectorAll('[data-uscraper-row], [data-uscraper-next]').forEach(functi...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 3920,
      "position_y": 600,
      "width": 340,
      "height": 140,
      "z_index": 22,
      "data": {
        "block_id": "inject-javascript-2"
      }
    }
  ]
}