generate functionMon, 06 Mar 2023

use Nokogiri to get html before assigned tag

def html_before_tag(url, tag) doc = Nokogiri::HTML(open(url)) first_tag = doc.css(tag).first html = doc.to_s.split(first_tag.to_s)[0] end

Want to kickstart your project?Use the new AI Studio to create your code