Hey forum! I'm new here and would just like to say heya!
Well
to get started on my program I'm working on a program that downloads
info form World of Warcraft Armory website and then gives you
statistics about random stuff. I'm having a little trouble with getting
the XML. Here is the site: http://www.wowarmory.com/guild-info.xml?r=...Creature+Within
When
you right click and click View Page Source you get the XML document.
That is the exact text i want in my textbox of my form. So to recap: I
want to get the "View Page Source" code of the website posted above. Iv
tried the .documenttext and the .gethtml and .inner .outer ext ext but
it all returns HTML and not the XML document from the right click and
"View Page Source"
Sidenote(I found out that Google Chrome shows the html version but iexplore/firefox shows the XML version)
Can anyone help me? Post if need more details.
Thanks in advance
- Mike
Loading
MikePosted Jan 20, 2010, 4:24 PM
RenaePosted Jan 16, 2010, 7:28 AM
WebClient client = new WebClient();
// the crucial line
client.Headers[HttpRequestHeader.UserAgent] = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6";
// Download it to another file
client.DownloadFile(GuildURL, SaveFile);
// or get xml as string
string result = client.DownloadString(GuildURL);
Now that i know what it is, i had the same problem with php when i did it 2 years ago. To bad i didn't remember that.
Anyway thanks go to another wow player... :)
http://www.eggheadcafe.com/software/aspnet/33974363/how-to-save-html-page-sou.aspx
RenaePosted Jan 16, 2010, 6:53 AM
Did you ever figure this out. I have a php site that picks up the xml and populates a database, all works well there. Now I'm trying to convert the site to aspx but can't figure out how to get the xml in c sharp, just keep getting the html source.
If you figure it out please let me know.