Scala: XML Attribute parsing

后端 未结 4 1421
误落风尘
误落风尘 2021-01-02 02:02

I\'m trying to parse a rss feed that looks like this for the attribute \"date\":



    
        

        
4条回答
  •  感动是毒
    2021-01-02 02:45

    Attributes are retrieved using the "@attrName" selector. Thus, your selector should actually be something like the following:

    println((rssFeed \\ "channel" \\ "item" \ "c" \ "@date").text)
    

提交回复
热议问题