Created
October 6, 2009 23:27
-
-
Save alohasoftworks/203569 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.wowarmory.com/character-sheet.xml?r=Kirin+Tor&n=Sachiyo"); | |
| request.UserAgent = @"Mozilla/5.0 Gecko/20070219 Firefox/2.0.0.2"; | |
| HttpWebResponse response = (HttpWebResponse) request.GetResponse(); | |
| String strResponse = String.Empty; | |
| XDocument xml; | |
| using (StreamReader sr = new StreamReader(response.GetResponseStream())) | |
| { | |
| xml = XDocument.Parse(sr.ReadToEnd()); | |
| //strResponse = sr.ReadToEnd(); | |
| } | |
| var q = from character in xml.Descendants("characterInfo") | |
| select new | |
| { | |
| BattleGroup = character.Element("character").Attribute("battleGroup").Value, | |
| }; | |
| foreach(var character in q) | |
| { | |
| Console.WriteLine(character.BattleGroup); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment