jackwener/OpenCLI · error · CommandExecutionError

BOSS search page did not expose its job-list response

Error message

BOSS search page did not expose its job-list response

What it means

captureJobList navigates and reads captured network responses looking for a payload whose zpData.jobList is an array (the BOSS search API response). After checking captured entries — asserting OK on non-zero codes — if no response ever exposed the job list, it throws this CommandExecutionError.

Source

Thrown at clis/boss/search.js:124

        for (const entry of Array.isArray(captures) ? captures : []) {
            if (!String(entry?.url || '').includes('joblist.json') ||
                Number(entry?.responseStatus || 0) !== 200 ||
                typeof entry?.responsePreview !== 'string') {
                continue;
            }
            let payload;
            try {
                payload = JSON.parse(entry.responsePreview);
            } catch {
                continue;
            }
            if (payload && typeof payload === 'object' && 'code' in payload && payload.code !== 0) {
                assertOk(payload, 'BOSS search failed');
            }
            if (Array.isArray(payload?.zpData?.jobList)) return payload;
        }
    }
    throw new CommandExecutionError('BOSS search page did not expose its job-list response');
}
cli({
    site: 'boss',
    name: 'search',
    access: 'read',
    description: 'BOSS直聘搜索职位(不带关键词时返回为你推荐职位)',
    domain: 'www.zhipin.com',
    strategy: Strategy.INTERCEPT,
    navigateBefore: false,
    browser: true,
    defaultWindowMode: 'background',
    siteSession: 'persistent',
    args: [
        { name: 'query', positional: true, help: 'Search keyword (optional, empty = recommended jobs)' },
        { name: 'city', default: '北京', help: 'City name or code (e.g. 杭州, 上海, 101010100)' },
        { name: 'experience', default: '', help: 'Experience: 在校生(实习)/应届生(校招)/经验不限/1年以内/1-3年/3-5年/5-10年/10年以上' },
        { name: 'degree', default: '', help: 'Degree: 大专/本科/硕士/博士' },
        { name: 'salary', default: '', help: 'Salary: 3K以下/3-5K/5-10K/10-15K/15-20K/20-30K/30-50K/50K以上' },

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open the BOSS site in the automated browser and complete any captcha/login/verification, then retry
  2. Verify the account session is valid and the search page loads manually in that browser profile
  3. Retry after a delay — transient anti-bot throttling often clears
  4. Inspect captured responses (verbose mode) and update the zpData.jobList extraction path if BOSS changed its API shape
  5. Check that the target URL is reachable from the browser (no proxy/firewall blocking)

Example fix

// before
await cli('boss', 'search', { query: 'golang' }); // hits captcha, no jobList captured
// after: pre-check page state and retry with backoff
let jobs;
for (let i = 0; i < 3; i++) {
  try { jobs = await cli('boss', 'search', { query: 'golang' }); break; }
  catch (e) {
    if (!String(e.message).includes('did not expose')) throw e;
    await loginAndVerify(page); // complete captcha / re-login in the browser
    await sleep(5000 * (i + 1));
  }
}
Defensive patterns

Strategy: retry

Validate before calling

// pre-flight: ensure the session is logged in and the search page renders
await page.goto('https://www.zhipin.com/web/chat/index');
if (await page.$('.nc_iconfont,.verify-wrap')) throw new Error('complete BOSS verification first');

Try / catch

try {
  return await cli('boss', 'search', opts);
} catch (e) {
  if (String(e.message).includes('did not expose its job-list response')) {
    await backoff(2); // complete captcha/re-login, then retry
    return cli('boss', 'search', opts);
  }
  throw e;
}

Prevention

When it happens

Trigger: The search page never fired the job-list XHR (bot challenge/captcha, login wall, redirect to a verify page), the response shape changed (no zpData.jobList), or navigation failed so no matching request was captured within the retry attempts.

Common situations: BOSS anti-bot verification intercepting the page; recruiter account logged out so the page redirects; BOSS API version change renaming zpData.jobList; heavy throttling causing empty result pages without the standard payload; corporate proxy stripping responses.

Related errors


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