Method: Html2rss::AutoSource::Scraper::SemanticHtml.find_closest_selector
- Defined in:
- lib/html2rss/auto_source/scraper/semantic_html.rb
permalink .find_closest_selector(current_tag, selector: 'a[href]:not([href=""])') ⇒ Nokogiri::XML::Node?
Finds the closest matching selector upwards in the DOM tree
66 67 68 |
# File 'lib/html2rss/auto_source/scraper/semantic_html.rb', line 66 def self.find_closest_selector(current_tag, selector: 'a[href]:not([href=""])') current_tag.at_css(selector) || find_closest_selector_upwards(current_tag, selector:) end |