Fetch data from Wikipedia using Special:Export

lcpl gault

New Member
I am trying to fetch data from Wikipedia using \[code\]Special:Export\[/code\] Following is my markup, i am unable to understand why it does not get into the while loop? I get no errors though. Kindly Help.\[code\]Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim webRequest As System.Net.HttpWebRequest = CType(System.Net.WebRequest.Create("http://en.wikipedia.org/wiki/Special:Export/Train"), HttpWebRequest) webRequest.Credentials = System.Net.CredentialCache.DefaultCredentials webRequest.Accept = "text/xml" webRequest.UserAgent = "foo/bar" Dim webResponse As System.Net.HttpWebResponse = CType(webRequest.GetResponse, HttpWebResponse) Dim responseStream As System.IO.Stream = webResponse.GetResponseStream Dim reader As System.Xml.XmlTextReader = New XmlTextReader(responseStream) Dim NS As String = "http://www.mediawiki.org/xml/export-0.4/" Dim doc As XPathDocument = New XPathDocument(reader) reader.Close() webResponse.Close() Dim myXPathNavigator As XPathNavigator = doc.CreateNavigator Dim nodesText As XPathNodeIterator = myXPathNavigator.SelectDescendants("text", NS, False) While nodesText.MoveNext Response.Write((nodesText.Current.InnerXml + " ")) End While End Sub\[/code\]
 
Back
Top