parsel icon indicating copy to clipboard operation
parsel copied to clipboard

[FeatureRequest] Adding the command line interface.

Open starrify opened this issue 4 years ago • 2 comments

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"]

starrify avatar Jun 29 '20 22:06 starrify

FYI, there are already two CLI implementations:

  • parselcli: https://github.com/Granitosaurus/parsel-cli
  • parsel-cli: https://github.com/rmax/parsel-cli (seems unmaintained)

eliasdorneles avatar Jun 30 '20 13:06 eliasdorneles

And they are covered in the documentation.

Gallaecio avatar Jun 30 '20 17:06 Gallaecio