I'm having difficulty selecting a URL within an XML document using Nokogiri, have tried using CSS selectors which works fine apart from markup within the child. I think this has to be due to the brackets < being written as < and >. Is there a way around this?
<br /><strong>URL:</strong> <a href="https://url.com/">https://url.com/</a>
require 'cgi'
CGI.unescapeHTML('<br /><strong>URL:</strong> <a href="https://url.com/">https://url.com/</a>')
gives
<br /><strong>URL:</strong> <a href=\"https://url.com/\">https://url.com/</a>
Maybe you just need to unescape your html first
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.