Skip to content

browse-cli: get text crashes without selector, get html broken entirely #1740

@shrey150

Description

@shrey150

Environment

  • browse-cli version: 0.1.4
  • OS: macOS (Darwin 24.3.0)
  • Node: v22.22.0

Bug 1: browse get text crashes when called without a selector

Reproduce:

browse open https://example.com
browse get text

Expected: Returns all visible text on the page (or a clear error saying a selector is required).

Actual:

Error: Cannot read properties of null (reading 'startsWith')

Workaround: Pass "body" as the selector:

browse get text "body"   # works fine

Bug 2: browse get html errors with any selector

Reproduce:

browse open https://example.com
browse get html "h1"
browse get html "body"
browse get html "#anything"

Expected: Returns the innerHTML of the matched element.

Actual:

Error: page.deepLocator(...).innerHTML is not a function

Looks like deepLocator() returns an object that doesn't expose .innerHTML. Possibly a Playwright API mismatch — innerHTML() is a method on Playwright Locator, but deepLocator may return something else.

Workaround: Use browse get text <selector> or browse snapshot instead. No workaround for getting raw HTML.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions