scrapy / parsel

Parsel lets you extract data from XML/HTML documents using XPath or CSS selectors
BSD 3-Clause "New" or "Revised" License
1.14k stars 146 forks source link

[FeatureRequest] Adding the command line interface. #196

Open starrify opened 4 years ago

starrify commented 4 years ago

It would be helpful if there may be a command-line interface added for parsel, as existing tools (e.g. W3's html-xml-tools and pup in Golang) are not handy enough.

Expected usage example:

$ curl -s https://scrapy.org/ | parsel --css "div#scrapy-logo + p::text"
An open source and collaborative framework for extracting the data you need from websites.
$ curl -s https://scrapy.org/ | parsel --all --output-json --css "div#scrapy-logo ~ * ::text"
["An open source and collaborative framework for extracting the data you need from websites.", "In a fast, simple, yet extensible way.", "Maintained by", "Scrapinghub", "and", "many other contributors"]
eliasdorneles commented 4 years ago

FYI, there are already two CLI implementations:

Gallaecio commented 4 years ago

And they are covered in the documentation.