views:

177

answers:

1

In my ruby+mechanize(nokogiri) script I use this piece of code:

row.at_xpath('td[3]/div[1]/a/text()').to_s.strip

on a forum where the post title html looks like:

<a href="showthread.php?t=233891" >&lt;/body&gt; on Footer ?</a>

and I receive from xpath this string &lt;/body&gt; on Footer ?

I would like to get what I can see in the web browser </body> on Footer ?

How can I do that for all html escape characters/entities?

+1  A: 

Please take a look this post, to unescape htmlentities

or

There is a ruby package called htmlentities

S.Mark
@S.Mark: I didn't know it was called entities (too). htmlentities works like a charm.Thank you.
Radek
You're welcome, Radek.
S.Mark