{"repo":"suntong/cascadia","free":true,"listed":false,"github":"https://github.com/suntong/cascadia","clone":"git clone https://github.com/suntong/cascadia.git","description":"Go cascadia package command line CSS selector","language":"Go","stars":146,"topics":["cascadia","css-selector","html-source","extract","csv-table","tsv","html-text","web-scraper","web-scraping","command-line-tool"],"license":"MIT","category":"cli-tools","readme_excerpt":"cascadia TOC - cascadia - CSS selector CLI tool - Usage - $ cascadia - Examples - Download/install binaries - The binary executables - Distro package - Debian package - Install Source - Author - Contributors cascadia - CSS selector CLI tool The Go Cascadia package implements CSS selectors for html. This is the command line tool, started as a thin wrapper around that package, but growing into a better tool to test CSS selectors without writing Go code: Usage $ cascadia Its output has two modes, none-block selection mode and block selection mode , depending on whether the --piece parameter is given on the command line or not. For details about the concept of block and pieces, check out andrew-d/goscrape (in fact, cascadia was initially developed just for it, so that I don't need to tweak Go code, build & run it just to test out the block and pieces selectors). Here is the exception: - Inside each page, there's 1 or more blocks - some logical method of splitting up a page into subcomponents. - Inside each block, you define some number of pieces of data that you wish to extract. Each piece consists of a name, a selector, and what data to extract from the current block. This all sounds rather complicated, but in practice it's quite simple. See the next section for details. In summary, - The none-block selection mode will output the selection as HTML source by default but if -t , or --text cli option is provided, the none-block selection mode will output as text instead. - By defau","default_branch":null,"files":null,"tree":[],"storefront":"/r/suntong","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/suntong/cascadia/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}