Skip to content Skip to sidebar Skip to footer
Showing posts with the label Nokogiri

Strip Text From Html Document Using Ruby

There are lots of examples of how to strip HTML tags from a document using Ruby, Hpricot and Nokogi… Read more Strip Text From Html Document Using Ruby

How Can I Detect Errors In An Html Document Fragment With Ruby?

I'm collecting some HTML formatted content from a web form. Before saving this HTML content, I&… Read more How Can I Detect Errors In An Html Document Fragment With Ruby?

Repairing Invalid Html With Nokogiri (removing Invalid Tags)

I'm trying to tidy some retrieved HTML using the tidy-ext gem. However, it fails when the HTML … Read more Repairing Invalid Html With Nokogiri (removing Invalid Tags)

How To Parse Xml With Nokogiri Without Losing Html Entities?

If you look at the output below in the after section ruby is removing all the html entities. How to… Read more How To Parse Xml With Nokogiri Without Losing Html Entities?

How To Make Nokogiri Transparently Return Un/encoded Html Entities Untouched?

How can I use Nokogiri with having html entities (like German umlauts) untouched? I.e.: # this is f… Read more How To Make Nokogiri Transparently Return Un/encoded Html Entities Untouched?

Parse Html Into Rails Without New Record Every Time?

I have the following code which is parsing a HTML table as simply as possible. # Timestamp (Column … Read more Parse Html Into Rails Without New Record Every Time?

How Do I Select Either A Th Or A Td From A Table Row?

I'm using Nokogiri with Rails 5. How do I select either a 'th' element or a 'td… Read more How Do I Select Either A Th Or A Td From A Table Row?

Strip Text From HTML Document Using Ruby

There are lots of examples of how to strip HTML tags from a document using Ruby, Hpricot and Nokogi… Read more Strip Text From HTML Document Using Ruby