jackwener/OpenCLI · error · CommandExecutionError

LinkedIn company page rendered but no company name was found

Error message

LinkedIn company page rendered but no company name was found (layout drift or company not found)

What it means

The payload was a valid object but had no truthy name field, meaning the page rendered enough structure for the extractor to return an object yet no company name was found. The library flags this explicitly as either layout drift (selectors no longer match the name element) or a company page that does not exist.

Source

Thrown at clis/linkedin/company.js:106

    const match = parsed.pathname.match(COMPANY_URL_RE);
    if (!match?.[1]) {
        throw new CommandExecutionError('LinkedIn company extraction ended outside a company page');
    }
    let slug;
    try {
        slug = decodeURIComponent(match[1]);
    } catch {
        throw new CommandExecutionError('LinkedIn company extraction returned a malformed company slug');
    }
    return `https://${LINKEDIN_DOMAIN}/company/${encodeURIComponent(slug)}/about/`;
}

function normalizeCompanyInfo(info, targetUrl) {
    if (!info || typeof info !== 'object' || Array.isArray(info)) {
        throw new CommandExecutionError('LinkedIn company extraction returned a malformed payload');
    }
    if (!info.name) {
        throw new CommandExecutionError('LinkedIn company page rendered but no company name was found (layout drift or company not found)');
    }
    let followers = 0;
    if (info.followers) {
        followers = Number(info.followers);
        if (!Number.isFinite(followers)) {
            throw new CommandExecutionError('LinkedIn company extraction returned a malformed followers count');
        }
    }
    return {
        name: String(info.name),
        industry: String(info.industry || ''),
        size: String(info.size || ''),
        headquarters: String(info.headquarters || ''),
        founded: String(info.founded || ''),
        website: String(info.website || ''),
        specialties: String(info.specialties || ''),
        followers,
        about: String(info.about || ''),

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Update the library so its name selectors match the current LinkedIn layout
  2. Verify the company page exists and is publicly viewable in a browser while logged in
  3. Re-authenticate the scraping session — restricted/logged-out views often omit the name
  4. Retry later if LinkedIn was serving an A/B layout variant
Defensive patterns

Strategy: try-catch

Type guard

function hasName(v) { return v !== null && typeof v === 'object' && !Array.isArray(v) && typeof v.name === 'string' && v.name.length > 0; }

Try / catch

try {
  const info = await company({ url: target });
} catch (err) {
  if (String(err.message).includes('no company name was found')) {
    // verify the company exists / update library for layout drift, then retry
    return withRetry(() => company({ url: target }), 1);
  }
  throw err;
}

Prevention

When it happens

Trigger: Extraction succeeded structurally but LinkedIn rendered a 'page not found' or restricted-view variant of the company page so the name element was absent; CSS selector for the name changed in a LinkedIn markup update.

Common situations: Company page deleted, renamed, or region-blocked; logged-out session seeing a truncated page without the name header; library out of date with LinkedIn's current DOM structure.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/33b0f6df1b69387c. Report an issue: GitHub.