/domp

DOM parser tool.

Primary LanguageGo

DOMparser

Description

Can type for JQuery like because this tool is wrapping the "goquery".

Usage

domp [option] [selector]

$ curl www.example.com | domp '#id > .class a'

Ootion

--ouput, -o

output format.

  • csv => csv format.
  • json => json format.
  • text => space seperate text.

default "text"

$ curl www.example.com | domp -o csv '#id > .class a'

--query, -q

query is output data.

  • text
  • html
  • outerhtml
  • attrs
  • attr@attribute

default "text"

And can use multiple query. ( seperator is "|" )

$ curl www.example.com | domp -q 'attr@alt|attr@src' -o csv 'img'
# image1,/img/1.jpg
# image2,/img/2.jpg
# ...

Install

To install, use go get:

$ go get -d github.com/muramako/domp

Contribution

  1. Fork (https://github.com/muramako/domp/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create a new Pull Request

Author

muramako

TODO

  • Write test.