News for hackers. Stuff that matters.
Re:Show HN: Crul || Query Any Webpage or API by zerop on Tuesday February 28, 2023 @10:17PM (#34978346)
This requires me to know the HTML structure in advance. I want to do it on any page. Mozilla has readability JS which does it, wanted to know if this tool has the same feature. BTW it's a great tool.
Re:Show HN: Crul || Query Any Webpage or API by portInit on Tuesday February 28, 2023 @10:29PM (#34978416)
Thank you! The query below would get you the full page text, although it likely wont be too legible. I'll read up on readability JS some, it looks quite magic and could possibly be added in.

open https://news.ycombinator.com/item?id=34970917 || filter "(nodeName == 'BODY')" || table innerText

Often you can use crul to discover the html structure in the results table. With a `find "text string"` to filter rows and then a filter on the column values that identify the desired elements.