Skip to content

[Bug]: xiaohongshu search silently returns [] when search page is behind login wall #296

@xiaokuili

Description

@xiaokuili

Description

opencli xiaohongshu search ... can silently return [] when the Xiaohongshu search results page is actually blocked by the login wall.

In my case, other Xiaohongshu commands such as feed worked, so the browser bridge / extension setup looked healthy. But search returned an empty array with no hint that the page body was showing 登录后查看搜索结果.

This makes it easy to misdiagnose the problem as:

  • no results for the keyword, or
  • broken DOM selectors / broken search adapter

when the real issue is that the current browser session is not allowed to view the search results page.

Steps to Reproduce

  1. Make sure opencli doctor is healthy and the browser bridge is connected.
  2. Be in a browser state where Xiaohongshu search results are behind the login wall.
  3. Run:
    opencli xiaohongshu search 特斯拉 --limit 5 -f json
  4. Observe that the command returns:
    []
  5. Open the same search URL in Chrome and check the page body. It shows 登录后查看搜索结果 instead of actual result cards.

Expected Behavior

The command should detect the login wall and show an explicit error or warning, instead of silently returning [].

For example, something like:

Xiaohongshu search results are blocked behind a login wall for the current browser session.
Open the search page in Chrome, sign in, then retry.

OpenCLI Version

1.3.1

Node.js Version

22.x

Operating System

macOS

Logs / Screenshots

Before signing in on the search page:

opencli xiaohongshu search 特斯拉 --limit 5 -f json
[]

After signing in on the search page, the same command returned normal results.

This suggests the adapter should distinguish between:

  • truly empty search results
  • search results blocked by login wall

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions