module Ferrum::Frame::DOM

def at_css(selector, within: nil)

Returns:
  • (Node, nil) -

Parameters:
  • within (Node, nil) --
  • selector (String) --
def at_css(selector, within: nil)
  expr = <<~JS
    function(selector, within) {
      within ||= document
      return within.querySelector(selector);
    }
  JS
  evaluate_func(expr, selector, within)
end