V
V
Vermuth2014-03-14 14:40:57
Ruby on Rails
Vermuth, 2014-03-14 14:40:57

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>

Please advise or give me a link where I can find a solution for this issue.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question