class Crystagiri::HTML
- Crystagiri::HTML
- Reference
- Object
Overview
Represent an Html document who can be parsed
Defined in:
crystagiri/html.crConstructors
-
.from_file(path : String) : HTML
Initialize an Html object from content of file designed by the given filepath
-
.from_url(url : String, follow : Bool = false) : HTML
Initialize an Html object from Html source fetched from the url
-
.new(content : String)
Initialize an Html object from Html source
Class Method Summary
-
.css_query_to_xpath(query : String) : String
Transform the css query into an xpath query
Instance Method Summary
-
#at_css(query : String)
Find first node corresponding to the css query and return
Crystagiri::Tag
if founded or a nil if not founded -
#at_id(id_name : String) : Crystagiri::Tag?
Find a node by its id and return a
Crystagiri::Tag
founded or a nil if not founded -
#at_tag(tag_name : String) : Crystagiri::Tag?
Find first tag by tag name and return
Crystagiri::Tag
founded or a nil if not founded - #content : String
-
#css(query : String, &block) : Array(Tag)
Find all node corresponding to the css query and yield
Crystagiri::Tag
founded or a nil if not founded - #nodes : XML::Node
-
#where_class(class_name : String, &block) : Array(Tag)
Find all nodes by classname and yield
Crystagiri::Tag
founded -
#where_tag(tag_name : String, &block) : Array(Tag)
Find all nodes by tag name and yield
Crystagiri::Tag
founded
Constructor Detail
Initialize an Html object from content of file designed by the given filepath
Initialize an Html object from Html source fetched from the url
Class Method Detail
Instance Method Detail
Find first node corresponding to the css query and return
Crystagiri::Tag
if founded or a nil if not founded
Find a node by its id and return a
Crystagiri::Tag
founded or a nil if not founded
Find first tag by tag name and return
Crystagiri::Tag
founded or a nil if not founded
Find all node corresponding to the css query and yield
Crystagiri::Tag
founded or a nil if not founded
Find all nodes by classname and yield
Crystagiri::Tag
founded
Find all nodes by tag name and yield
Crystagiri::Tag
founded