# frozen_string_literal: true module HoTModuLe # Add a couple familar DOM API features to Nokogiri module QuerySelection # @param selector [String] # @return [Nokogiri::XML::Element] def query_selector(selector) = at_css(selector) # @param selector [String] # @return [Nokogiri::XML::Element] def query_selector_all(selector) = css(selector) end Nokogiri::XML::Node.include QuerySelection unless Nokogiri::XML::Node.instance_methods.include?(:query_selector) end