jackwener/OpenCLI · error · CommandExecutionError

LinkedIn sent invitation cards were not found; the page stru

Error message

LinkedIn sent invitation cards were not found; the page structure may have changed.

What it means

This CommandExecutionError is thrown when the sent-invitations scraper found zero invitation cards but LinkedIn did NOT render a recognizable empty-state. The command cannot distinguish 'no invitations' from 'the page HTML changed', so it fails conservatively and suggests the page structure may have changed.

Source

Thrown at clis/linkedin/sent-invitations.js:112

    let result = unwrapEvaluateResult(await page.evaluate(buildSentInvitationsScript()));
    if (result?.authRequired) {
      throw new AuthRequiredError(LINKEDIN_DOMAIN, 'LinkedIn sent invitations requires an active signed-in browser session.');
    }
    if (result?.warning) {
      throw new CommandExecutionError('LinkedIn warning/restriction state visible on sent invitations page.');
    }
    if (!result || typeof result !== 'object' || Array.isArray(result) || !Array.isArray(result.rows)) {
      throw new CommandExecutionError('LinkedIn sent invitations returned a malformed extraction payload.');
    }
    if (result.malformedCount > 0) {
      throw new CommandExecutionError('LinkedIn sent invitations contained a malformed invitation card.');
    }
    const rows = result.rows;
    if (rows.length === 0) {
      if (result.explicitEmpty) {
        throw new EmptyResultError('linkedin sent-invitations', 'No pending sent invitations were found.');
      }
      throw new CommandExecutionError('LinkedIn sent invitation cards were not found; the page structure may have changed.');
    }
    return rows.map((row, index) => ({
      rank: index + 1,
      name: row.name || '',
      profile_url: row.profile_url || '',
      invited_date_text: row.invited_date_text || '',
    }));
  },
});

export const __test__ = {
  buildSentInvitationsScript,
};

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open the sent-invitations page in the browser session and confirm what LinkedIn actually renders; if it is a real empty state, report/update the empty-state detector.
  2. Update the card/empty-state selectors in the scraper to match current LinkedIn markup.
  3. Re-authenticate and retry to rule out an auth-wall or interstitial page being misread as empty content.
Defensive patterns

Strategy: retry

Try / catch

try {
  rows = await runCommand('linkedin sent-invitations');
} catch (e) {
  if (/page structure may have changed/.test(e.message)) {
    // alert maintainers / retry once, then fail loudly
  }
}

Prevention

When it happens

Trigger: Running `linkedin sent-invitations` when result.rows is empty and result.explicitEmpty is false — the extractor matched no invitation card selectors and no explicit empty indicator was found on the page.

Common situations: LinkedIn shipped a DOM/markup change to the invitation manager; a login wall, CAPTCHA, or interstitial page replaced the list; a localized page renders an empty-state the detector does not recognize.

Related errors


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