Skip to content

Instantly share code, notes, and snippets.

@ZSendokame
Last active January 2, 2025 21:40
Show Gist options
  • Select an option

  • Save ZSendokame/d3894b86e6db776b826b2af76e2c89c6 to your computer and use it in GitHub Desktop.

Select an option

Save ZSendokame/d3894b86e6db776b826b2af76e2c89c6 to your computer and use it in GitHub Desktop.
Small script to do scraping from the terminal.
import fly
import arguing
args = arguing.Arguing()
selector = args.set('--selector', required=True)
work = args.set('--map')
html = fly.HTML(args.pipe())
selected = html.css(selector)
for match in selected:
if work is not None:
print(eval(work, {'tag': match}))
else:
print(match.text())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment