Class: Sawzall::Element
- Inherits:
-
Object
- Object
- Sawzall::Element
- Defined in:
- lib/sawzall.rb
Instance Method Summary collapse
-
#attr(attribute) ⇒ String, Nil
Returns the given attribute’s value or
nil
. -
#child_elements ⇒ Array<Sawzall::Element>
Returns the element’s child elements.
-
#html ⇒ String
Returns the element’s outer HTML.
-
#inner_html ⇒ String
Returns the element’s inner HTML.
-
#name ⇒ String
Returns the element’s name in lowercase.
-
#select(css_selector) ⇒ Array<Sawzall::Element>
Returns the child elements that match the given CSS selector.
-
#text ⇒ String
Returns the element’s text content using a very simplified version of the
innerText
algorithm.
Instance Method Details
#attr(attribute) ⇒ String, Nil
Returns the given attribute’s value or nil
|
# File 'lib/sawzall.rb', line 39
|
#child_elements ⇒ Array<Sawzall::Element>
Returns the element’s child elements
|
# File 'lib/sawzall.rb', line 71
|
#html ⇒ String
Returns the element’s outer HTML
|
# File 'lib/sawzall.rb', line 11
|
#inner_html ⇒ String
Returns the element’s inner HTML
|
# File 'lib/sawzall.rb', line 25
|
#name ⇒ String
Returns the element’s name in lowercase
|
# File 'lib/sawzall.rb', line 2
|
#select(css_selector) ⇒ Array<Sawzall::Element>
Returns the child elements that match the given CSS selector
|
# File 'lib/sawzall.rb', line 51
|
#text ⇒ String
Returns the element’s text content using a very simplified version of the innerText
algorithm.
developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText
|
# File 'lib/sawzall.rb', line 90
|