Crystagiri Versions Save

An Html parser library for Crystal (like Nokogiri for Ruby)

v0.4.0-alpha

5 years ago

News

  • New parsing engine #12 (thanks to @giuseongit )
  • Extends Crystagiri::Tag API #13 (thanks to @giuseongit )

v0.3.5

5 years ago

News:

  • Add possibilty to follow redirect link #11 (thanks to @giuseongit )

v0.3.4

5 years ago
  • Make block return #5

v0.1.0

7 years ago

Initial release

In this first version you can only parse Html file represented by Crystagiri::HTML. You can instanciate it from :

doc = Crystagiri::HTML.new "<h1>Crystagiri is awesome!!</h1>"
doc = Crystagiri::HTML.from_file "README.md"
doc = Crystagiri::HTML.from_url "http://example.com/"

Then you can search all XML::Node by:

  • HTML tag
doc.tag("h2") { |node| puts node }
# => <h2> .. </h2>
# => <h2> .. </h2>
# => <h2> .. </h2>
  • HTML id
puts doc.at_id("main-content") 
# => <div id="main-content"> ... </div>
  • HTML class attribute
doc.class("summary") { |node| puts node }
# => <div class="summary"> .. </div>
# => <div class="summary"> .. </div>
# => <div class="summary"> .. </div>

v0.2.0

7 years ago

new feature

  • Implement css query
doc.css("#main-content ol.steps") {|node| puts node}
# => <ol class="steps"> .. </ol>
doc.css("#body>quote.introduction") {|node| puts node}
# => <quote class="introduction"> .. </quote>

v0.2.1

7 years ago

Corrections

  • Rename Crystagiri::HTML.class method as Crystagiri::HTML.where_class.
  • To be more logic, I renamed also Crystagiri::HTML.tag into Crystagiri::HTML.where_tag
  • Correct a bug when user search only a class with Crystagiri::HTML.css

v0.3.0

7 years ago

feature

  • Add anew Crystagiri::Tag class who include a XML::Node variable and add more usefull method
  • add a benchmark between Crystagiri & Nokogiri

v0.3.1

7 years ago

Correction

  • correct impossibility to found a node who contains a number in its classname

v0.3.2

7 years ago

Correction

  • correct impossibility to found a node who contains a number in its classname

0.3.2

7 years ago

Correction

  • add a bulletproof CSS to XPath converter