pup is a command line tool for processing HTML. It reads from stdin, prints to stdout, and allows the user to filter parts of the page using CSS selectors. Inspired by jq, pup aims to be a fast and flexible way of exploring HTML from the terminal. If you have Go installed on your computer just run go get. If you're on OS X, use Homebrew to install (no Go required). By default pup will fill in missing tags and properly indent the page. CSS selectors have a group of specifiers called "pseudo classes" which are pretty cool. pup implements a majority of the relevant ones them. When combining selectors, the HTML nodes selected by the previous selector will be passed to the next ones. Non-HTML selectors which effect the output type are implemented as functions which can be provided as a final argument. Print the values of all attributes with a given key from all selected nodes.

Features

  • Clean and indent
  • Filter by tag
  • Filter by id
  • Filter by attribute
  • Pseudo Classes
  • Print HTML as JSON

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow pup

pup Web Site

You Might Also Like
User-friendly software for hybrid working and hot desking in your organisation. Icon
Efficient workspace management FlexWhere, a Dutchview application, is a convenient software application for organizations that work flexibly. These organizations employees do not have a fixed workspace. Using FlexWhere, they find out quickly and easily which flex places and meeting rooms are free and where their colleagues are located. The information can be viewed on a display, desktop or laptop. By using the mobile app, FlexWhere can even be consulted outside the office on a tablet or phone. More and more organizations are working with flexible workplaces. That is opening up all kinds of possibilities, but is also raising questions such as: ‘How do I know where there is a free workplace?’, ‘Where can I find the colleague I need?’, ‘Is there a conference space available on this floor?’. FlexWhere answers those questions, so it is ideal for supporting (the transition to) flexible work.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of pup!

Additional Project Details

Operating Systems

Mac, Windows

Registered

2021-09-03