我基本上是想从我对 ChartLyrics API 的响应中获取 Lyric 标签。这是我写的代码:
require 'nokogiri'
require 'open-uri'
request = Net::HTTP.get(URI.parse('http://api.chartlyrics.com/apiv1.asmx/GetLyric?lyricId=1710&lyricCheckSum=a4a56a99ee00cd8e67872a7764d6f9c6'))
puts request
response = Nokogiri::XML(request)
puts response.xpath("//Lyric")[0].to_s
我已阅读文档,但没有找到答案。我在这里做错了什么?