jackwener/OpenCLI · error · ArgumentError
xueqiu comments supports --limit up to 100
Error message
xueqiu comments supports --limit up to 100
What it means
The xueqiu comments command caps the number of fetched comments at 100. If --limit exceeds 100, an ArgumentError is thrown because the scraper's pagination strategy (pageSize 20, maxRequests 5) can collect at most 100 rows per run.
Source
Thrown at clis/xueqiu/comments.js:323
navigateBefore: false,
args: [
{
name: 'symbol',
positional: true,
required: true,
help: 'Stock symbol, e.g. SH600519, AAPL, or 00700',
},
{ name: 'limit', type: 'int', default: 20, help: 'Number of discussion posts to return' },
],
columns: ['author', 'text', 'likes', 'replies', 'retweets', 'created_at', 'url'],
func: async (page, args) => {
const symbol = normalizeSymbolInput(args.symbol);
const limit = Number(args.limit);
if (!Number.isInteger(limit) || limit <= 0) {
throw new ArgumentError('xueqiu comments requires --limit to be a positive integer');
}
if (limit > 100) {
throw new ArgumentError('xueqiu comments supports --limit up to 100');
}
const pageSize = Math.min(limit, 20);
await page.goto('https://xueqiu.com');
const rows = await collectCommentRows({
symbol,
limit,
pageSize,
maxRequests: 5,
fetchPage: (pageNumber, currentPageSize) => fetchCommentsPage(page, symbol, pageNumber, currentPageSize),
warn: log.warn,
});
return rows.map(row => toCommentOutputRow(row));
},
});
/**
* Convert raw CLI input into a normalized stock symbol.
*
* @param raw User-provided CLI argument.View on GitHub (pinned to 49907e53dc)
Solutions
- Reduce --limit to at most 100.
- Paginate manually: run the command multiple times if you need more than 100 comments (the API only exposes limited pages anyway).
- Clamp the value in scripts: --limit "$(( LIMIT > 100 ? 100 : LIMIT ))".
Example fix
// before clis/xueqiu comments AAPL --limit 500 // after clis/xueqiu comments AAPL --limit 100
Defensive patterns
Strategy: validation
Validate before calling
const limit = Number(rawLimit);
if (Number.isInteger(limit) && limit > 100) {
limit = 100; // clamp instead of failing
} Prevention
- Remember the hard cap: --limit max is 100.
- Clamp user-supplied values to 100 in wrapper scripts.
- Chain multiple invocations if more data is needed.
When it happens
Trigger: Running the xueqiu comments command with --limit greater than 100, e.g. --limit 500 or --limit 1000.
Common situations: Users assuming unlimited scraping like other tools, trying to backfill a long discussion thread in one call, or scripts computing a large limit from a target row count.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- xueqiu comments requires --limit to be a positive integer
- xueqiu comments only accepts a symbol, not a URL
- <train-no> "${trainNo}" does not look like a 12306 internal
- --from station must not be empty
- --to station must not be empty
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/69b16fab8a098d96.
Report an issue: GitHub.