SCRAPER(1)

πŸ“¦ version 0.29.0, in nixos 26.05, nixpkgs unstable

πŸ’… SCRAPER(1) β€” like, the scraper manual page, bestie ✨

okay so real quick: this is scraper from section 1 of the manual (general commands, the iconic ones), and honestly? she's giving main character energy for anyone who's ever needed to poke at some HTML. let's get into it πŸŽ€


✨ NAME ✨

scraper β€” HTML querying with CSS selectors. literally that's her whole thing, no cap πŸ’–


🌸 SYNOPSIS 🌸

scraper [-HIcint] [-a attr] [-d | -f] selector [file ...]

like, you give her a selector and optionally some file ...s and she does the rest. slay πŸ¦‹


πŸ’… DESCRIPTION πŸ’…

so the scraper utility parses HTML and then outputs the elements that match your CSS selectors. that's it, that's the vibe. πŸ”₯

the arguments are as follows (pay attention bestie, they're all important):

  • -H, --html β€” outputs the HTML of the matching elements. this one is the default btw, she's the baseline πŸ‘‘
  • -I, --inner-html β€” outputs the inner HTML of the matching elements. yes there's a difference and yes it matters πŸ’œ
  • -a attr, --attr attr β€” outputs the value of the attribute attr of the matching elements. very specific, very demure πŸŽ€
  • -c, --classes β€” outputs the classes of the matching elements. get those class names, periodt ✨
  • -d, --document β€” parses the input as HTML documents. this is the default too, so she's already doing it unless you say otherwise 🌈
  • -f, --fragment β€” parses the input as HTML fragments. for the lil pieces, iykyk 🧚
  • -i, --id β€” outputs the IDs of the matching elements. id supremacy fr fr πŸ’–
  • -n, --name β€” outputs the names of the matching elements. name 'em and claim 'em πŸ¦‹
  • -t, --text β€” outputs the text of the matching elements. just the words, nothing extra 😭

πŸ’€ EXIT STATUS πŸ’€

the scraper utility exits 0 on success, 1 if no elements match, and >1 if an error occurs.

so like, if she comes back with a 1 it's not a crash, it's just "bestie i found nothing" πŸ™ˆ and anything above 1? that's a real error, be concerned πŸ’€


🫢 AUTHORS 🫢

  • June McEnroe <june@causal.agency>
  • Vivek Kushwaha <yoursvivek@gmail.com>

the scraper utility relies heavily on code from the Servo project: https://servo.org β€” iconic behavior honestly, standing on the shoulders of legends πŸ‘‘


and that's the page!! πŸ“ this edition shipped with Debian, dated October 29, 2018 β€” vintage but still serving πŸ’… stay nosy, stay querying, mwah πŸ’œ

πŸ“¦ where this page comes from