class Arachnid::Resource
- Arachnid::Resource
- Reference
- Object
Overview
Represents a resource requested from a website
Included Modules
- Arachnid::Resource::ContentTypes
- Arachnid::Resource::Cookies
- Arachnid::Resource::HTML
- Arachnid::Resource::StatusCodes
Defined in:
arachnid/resource/content_types.crarachnid/resource/cookies.cr
arachnid/resource/html.cr
arachnid/resource/status_codes.cr
arachnid/resource.cr
Constructors
-
.new(url : URI, response : Halite::Response)
Creates a new
Resource
object.
Instance Method Summary
-
#%(path)
Alias for
#at
-
#/(path)
Alias for
#search
-
#at(path)
Searches for the first occurrence of an XPath or CSS path
- #at_css(*args, **options)
- #at_css(*args, **options, &block)
- #at_id(*args, **options)
- #at_id(*args, **options, &block)
- #at_tag(*args, **options)
- #at_tag(*args, **options, &block)
-
#body
The body of the response
- #css(*args, **options, &block)
- #css(*args, **options)
-
#doc
Returns a parsed document for HTML, XML, RSS, and Atom resources.
-
#headers : HTTP::Headers
Headers returned with the body
-
#response : Halite::Response
HTTP response
- #root(*args, **options)
- #root(*args, **options, &block)
-
#search(path)
Searches the document for XPath or CSS paths
-
#size
Get the size of the body in bytes (useful for binaries)
- #to_s
-
#url : URI
URL of the resource
- #where_class(*args, **options)
- #where_class(*args, **options, &block)
- #where_tag(*args, **options)
- #where_tag(*args, **options, &block)
- #xpath(*args, **options, &block)
- #xpath(*args, **options)
- #xpath_bool(*args, **options)
- #xpath_bool(*args, **options, &block)
- #xpath_float(*args, **options, &block)
- #xpath_float(*args, **options)
- #xpath_node(*args, **options, &block)
- #xpath_node(*args, **options)
- #xpath_nodes(*args, **options, &block)
- #xpath_nodes(*args, **options)
- #xpath_string(*args, **options, &block)
- #xpath_string(*args, **options)