--json wraps the human-readable output in a string rather than emitting structured data, so scripting still means parsing prose.
playwright-cli --json find "Research Scientist" returns:
{
"result": "Found 1 match for \"Research Scientist\":\n\n- generic [ref=e2]:\n - generic [ref=e8]:\n - link [ref=e73] [cursor=pointer]:\n - /url: /pangramlabs/64baa007...\n - heading \"AI Research Scientist (NLP)\" [level=3] [ref=e75]"
}
The refs, roles, names and urls are all in there, but only as formatted text. Consuming it needs a parser for the indentation format, which defeats the point of the flag.
Emitting the node tree instead — role, name, ref, url, children — would make the CLI usable from scripts without a parser. Version 0.1.17.
--jsonwraps the human-readable output in a string rather than emitting structured data, so scripting still means parsing prose.playwright-cli --json find "Research Scientist"returns:{ "result": "Found 1 match for \"Research Scientist\":\n\n- generic [ref=e2]:\n - generic [ref=e8]:\n - link [ref=e73] [cursor=pointer]:\n - /url: /pangramlabs/64baa007...\n - heading \"AI Research Scientist (NLP)\" [level=3] [ref=e75]" }The refs, roles, names and urls are all in there, but only as formatted text. Consuming it needs a parser for the indentation format, which defeats the point of the flag.
Emitting the node tree instead — role, name, ref, url, children — would make the CLI usable from scripts without a parser. Version 0.1.17.