This example in the readme makes it seem as if there's a way to limit the output to the first result:
first element
$ curl -s https://github.com/mlwmlw/cheerio-cli/commits/master | cheerio "a.commit-tease-sha"
07b0406
However it always prints all results.
Example:
$ curl -s https://boerse.ard.de/multimedia/audios-und-videos/boerse-vor-acht/index.html | cheerio
'.teaser a' -a href
https://boerse.ard.de/multimedia/audios-und-videos/boerse-vor-acht/hr_24_01_2020_110.html
https://boerse.ard.de/multimedia/audios-und-videos/boerse-vor-acht/hr_23_01_2020_112.html
https://boerse.ard.de/multimedia/audios-und-videos/boerse-vor-acht/hr_22_01_2020_112.html
https://boerse.ard.de/multimedia/audios-und-videos/boerse-vor-acht/hr_21_01_2020_114.html
https://boerse.ard.de/multimedia/audios-und-videos/boerse-vor-acht/hr_21_01_2020_100.html
It also has some problem with the output being piped into head:
curl -s https://boerse.ard.de/multimedia/audios-und-videos/boerse-vor-acht/index.html | cheerio
'.teaser a' -a href | head -n1
https://boerse.ard.de/multimedia/audios-und-videos/boerse-vor-acht/hr_24_01_2020_110.html
events.js:174
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at WriteWrap.afterWrite [as oncomplete] (net.js:789:14)
Emitted 'error' event at:
at errorOrDestroy (internal/streams/destroy.js:107:12)
at onwriteError (_stream_writable.js:436:5)
at onwrite (_stream_writable.js:461:5)
at _destroy (internal/streams/destroy.js:49:7)
at Socket.dummyDestroy [as _destroy] (internal/process/stdio.js:17:5)
at Socket.destroy (internal/streams/destroy.js:37:8)
at WriteWrap.afterWrite [as oncomplete] (net.js:791:10)
This example in the readme makes it seem as if there's a way to limit the output to the first result:
However it always prints all results.
Example:
It also has some problem with the output being piped into
head: