{
  "version": "1.0.0",
  "exported_at": "2026-05-31T18:00:00.000Z",
  "project": {
    "name": "Yellow Pages Details Scraper Australia",
    "description": "Scrapes Yellowpages.com.au business detail/listing pages supplied as input URLs. Uses a multi-URL navigation loop so every URL in navigate.urls is visited, one business row is appended per detail page, and fields equivalent to the Octoparse Yellow Pages Details Scraper are exported. Best-effort extraction uses JSON-LD plus DOM fallbacks for phone, address, geo, website, email, opening hours, ABN/ACN, employees, established year, and trading names.",
    "color": "bg-[#ff832b]",
    "template_id": "ai-generated-yellow-pages-australia-details"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Set browser viewport size",
      "position_x": 120,
      "position_y": 240,
      "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": 240,
      "config": {
        "urls": [
          "https://www.yellowpages.com.au/act/mitchell/bridgestone-select-1000002663303-listing.html",
          "https://www.yellowpages.com.au/act/gungahlin/paul-whyte-automotive-14502099-listing.html"
        ],
        "color": "bg-[#4589ff]",
        "tags": [
          "yellowpages",
          "multi-url-input"
        ]
      }
    },
    {
      "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": 240,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Run custom JavaScript on the page",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "jsCode": "(function(){const clean=s=>(s||'').replace(/\\s+/g,' ').trim();const q=(sel,root=document)=>root.querySelector(sel);const text=(sel,root=document)=>{const e=q(sel,root);return e?clean(e.innerText||e.textContent||''):''};function ldItems(){const out=[];document.querySelectorAll('script[type=\"application/ld+json\"]').forEach(s=>{try{const j=JSON.parse(s.textContent);(Array.isArray(j)?j:[j]).forEach(x=>{if(x&&x['@graph'])out.push(...x['@graph']);if(x)out.push(x);});}catch(e){}});return out;}function biz(){return ldItems().find(x=>{const t=Array.isArray(x['@type'])?x['@type'].join(' '):(x['@type']||'');return /LocalBusiness|Organization|Restaurant|AutoRepair|Store|ProfessionalService|LegalService/i.test(t);})||{};}function label(name){const re=new RegExp(name+'\\\\s*[:\\\\n]?\\\\s*([^\\\\n]+)','i');const m=(document.body.innerText||'').match(re);return clean(m&&m[1]||'');}function address(){const b=biz();const a=b.address;if(typeof a==='string')return clean(a);if(a)return clean([a.streetAddress,a.addressLocality,a.addressRegion,a.postalCode].filter(Boolean).join(' '));return text('[itemprop=\"address\"], [class*=\"address\"], [data-testid*=\"address\"]');}function externalSite(){const bad=/yellowpages\\.com\\.au|google\\.|gstatic|facebook|twitter|instagram|linkedin|maps\\.google|mailto:|tel:/i;const links=Array.from(document.links).filter(a=>/^https?:/i.test(a.href)&&!bad.test(a.href));let l=links.find(a=>/website|visit|view website|www|\\.com|\\.com\\.au/i.test(clean(a.textContent)+' '+a.href))||links[0];return l?l.href:'';}function hours(){const b=biz();const oh=b.openingHoursSpecification||b.openingHours;if(Array.isArray(oh))return oh.map(o=>typeof o==='string'?o:clean([].concat(o.dayOfWeek||[]).join(', ')+' '+(o.opens||'')+(o.closes?' - '+o.closes:''))).join(' | ');if(typeof oh==='string')return clean(oh);const el=Array.from(document.querySelectorAll('*')).find(e=>/hour|opening/i.test(e.className||'')&&clean(e.innerText).length>10&&clean(e.innerText).length<1200);return el?clean(el.innerText):'';}function geo(idx){const b=biz();if(b.geo&&(b.geo.latitude||b.geo.longitude))return idx===0?(b.geo.latitude||''):(b.geo.longitude||'');const html=document.documentElement.innerHTML;const m=html.match(/markers=[^\"']*?(-?\\d+\\.\\d+),(-?\\d+\\.\\d+)/i)||html.match(/(-?\\d+\\.\\d+)\\s*,\\s*(-?\\d+\\.\\d+)/);return m?(idx===0?m[1]:m[2]):'';}function rx(re){const m=(document.body.innerText||'').match(re);return clean(m&&m[1]||'');}Array.from(document.querySelectorAll('button,a')).filter(e=>/show|reveal|email|website|number|phone/i.test(clean(e.innerText||e.getAttribute('aria-label')||e.title||''))).slice(0,8).forEach(e=>{try{e.click();}catch(_){}});window.__ypExtract={listingId:()=>{const m=location.href.match(/-(\\d+)-listing\\.html/i)||document.documentElement.innerHTML.match(/listingId[\"'\\s:=]+(\\d+)/i);return m?m[1]:'';},businessName:()=>biz().name||text('h1,[itemprop=\"name\"],[data-testid*=\"name\"]'),department:()=>label('Department')||text('[class*=\"category\"],[data-testid*=\"category\"]')||rx(/Categories?\\s*[:\\n]\\s*([^\\n]+)/i),address:address,latitude:()=>geo(0),longitude:()=>geo(1),telephone:()=>{const b=biz();const tel=q('a[href^=\"tel:\"]');return clean((b.telephone||'')||(tel?tel.textContent||tel.href.replace(/^tel:/,''):''));},email:()=>{const a=q('a[href^=\"mailto:\"]');return a?clean(a.href.replace(/^mailto:/,'').split('?')[0]):rx(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}/i);},website:()=>biz().url&&!/yellowpages\\.com\\.au/i.test(biz().url)?biz().url:externalSite(),openingHours:hours,abn:()=>rx(/ABN\\s*:?\\s*([0-9 ]{11,})/i),acn:()=>rx(/ACN\\s*:?\\s*([0-9 ]{9,})/i),employees:()=>rx(/(?:Number of employees|Employees)\\s*:?\\s*([^\\n]+)/i),established:()=>rx(/Established\\s*:?\\s*([0-9]{4})/i),alsoTradeAs:()=>rx(/(?:Also trade as|Also trades as|Trading as)\\s*:?\\s*([^\\n]+)/i),sourceUrl:()=>location.href};})();",
        "waitForCompletion": true,
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1560,
      "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": 1920,
      "position_y": 240,
      "config": {
        "selector": "body",
        "timeout": 20,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2280,
      "position_y": 240,
      "config": {
        "rowSelector": "body",
        "fileName": "yellow-pages-australia-scraper-product-details.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "tags": [
          "yellowpages",
          "business-details",
          "structured-export"
        ],
        "columns": [
          {
            "name": "Listing_ID",
            "selector": "window.__ypExtract.listingId()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Business_name",
            "selector": "window.__ypExtract.businessName()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Department",
            "selector": "window.__ypExtract.department()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Address",
            "selector": "window.__ypExtract.address()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Latitude",
            "selector": "window.__ypExtract.latitude()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Longitude",
            "selector": "window.__ypExtract.longitude()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Telephone",
            "selector": "window.__ypExtract.telephone()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Email",
            "selector": "window.__ypExtract.email()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Website",
            "selector": "window.__ypExtract.website()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Opening_hours",
            "selector": "window.__ypExtract.openingHours()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ABN",
            "selector": "window.__ypExtract.abn()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ACN",
            "selector": "window.__ypExtract.acn()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Number_of_employees",
            "selector": "window.__ypExtract.employees()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Established",
            "selector": "window.__ypExtract.established()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Also_trade_as",
            "selector": "window.__ypExtract.alsoTradeAs()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Source_URL",
            "selector": "window.__ypExtract.sourceUrl()",
            "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": 240,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "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": "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-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 48,
      "position_y": 136,
      "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": 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": 1128,
      "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": 2208,
      "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": 2568,
      "position_y": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Yellowpages.com.au business detail/listing pages supplied as input URLs. Uses a multi-URL navigation loop so every URL in navigate.urls is visited, one business row is appended per detail page, and fields equivalent to the Octoparse Yellow Pages Details Scraper are exported. Best-effort extraction uses JSON-LD plus DOM fallbacks for phone, address, geo, website, email, opening hours, ABN/ACN, employees, established year, and trading names.",
      "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(){const clean=s=>(s||'').replace(/\\s+/g,' ').trim();const q=(sel,root=document)=>root.quer...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1400,
      "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 (Listing_ID, Business_name, Department, Address, Latitude). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 220,
      "width": 340,
      "height": 132,
      "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": 220,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}