Answer the question
In order to leave comments, you need to log in
How to solve problem when parsing xml with Nokogiri?
Hello!
I ran into a little problem parsing youtube playlists with the "Nokogiri" gem. I write in ruby, I can easily catch occurrences of "entry", "author" and other moments. But it does not come out to catch either as a "gd: feedLink" tag. Better yet, catch the field value "countHint=" in the same tag
def update_video
url = "some_url"
xml = Nokogiri::XML(open(url))
xml.seacrch('entry gd:feedLink')
end
<entry>
<id> ......</id>
<published>2013-02-27T12:22:02.000Z</published>
<updated>2014-03-14T05:44:24.000Z</updated>
<title type="text">Разное</title>
<author>
<name>...]</name>
<uri>.......</uri>
</author>
<gd:feedLink rel="......." href="......." countHint="56"/>
<yt:playlistId>.........</yt:playlistId>
</entry>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question