head -224 reonomy-scraper-v10-agent-browser.js >> /tmp/part1.js
cat >> /tmp/part1.js << 'FIXEDOWNEREXTRACTION'

  // Extract owner names from page text - simplified approach
  const bodyTextResult = await execAgentBrowser(['eval', 'document.body.innerText'], 'Get body text');
  const bodyText = JSON.parse(bodyTextResult).result || '';

  // Look for "Owns X properties" pattern and extract owner name
  const ownerLines = bodyText.split('\n');
  for (const line of ownerLines) {
    const match = line.match(/Owns\s+(\d+)\s+properties?\s+in\s+([A-Z][a-z]+)/i);
    if (match) {
      const owner = match[2].trim();
      if (owner && owner.length > 3 && !ownerData.ownerNames.includes(owner)) {
        ownerData.ownerNames.push(owner);
      }
    }
  }

  log(`   👤 Owners found: ${ownerData.ownerNames.length}`);
ENDOFSCRIPT'
tail +20 /tmp/part1.js >> /tmp/fixed_reonomy.js
cat /tmp/fixed_reonomy.js > /Users/jakeshore/.clawdbot/workspace/reonomy-scraper-v10-agent-browser.js && echo "Script fixed and updated"