我正在尝试处理rss网址,但是却给了我一个错误 “' - '是一个意外的令牌。预期的令牌是'>'。第81行,第5位。”
当我查看源代码时,它在xml节点的中间有一个值“Knowledge @ Wharton - Innovation and Entrepreneurship”。
如何处理此网址并忽略该错误。
Public Shared Function HasRssItems() As Boolean
Dim myRequest As WebRequest
Dim myResponse As WebResponse
Try
myRequest = System.Net.WebRequest.Create("http://www.google.com/reader/shared/i.am.muralibala")
myRequest.Timeout = 5000
myResponse = myRequest.GetResponse()
Dim rssStream As Stream = myResponse.GetResponseStream()
Dim rssDoc As New XmlDocument()
rssDoc.Load(rssStream)
Return rssDoc.SelectNodes("rss/channel/item").Count > 0
Catch ex As Exception
Return False
Finally
myResponse.Close()
End Try
End Function
答案 0 :(得分:0)