Over a million developers have joined DZone.

Deleting An Element From Nokogiri

·
In this example all img elements are deleted from the Nokogiri HTML document.

doc2.xpath('//img').each {|x| x.remove}

Resources:
 - inserting and deleting nokogiri XML nodes and elements - Stack Overflow [stackoverflow.com]
Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}