Overview API Support Tutorials Changelog About Parsing an HTML / XML Document¶ From a String¶ We've tried to make this easy on you. Really! We're here to make your life easier. html_doc = Nokogiri::HTML("<html><body><h1>Mr. Belvedere Fan Club</h1></body></html>") xml_doc = Nokogiri::XML("<root><aliens><alien><name>Alf</name></alien></aliens></root>") The variables html_doc and xml_doc are Nokogiri