尝试从谷歌财务中读取时,xml没有价值 [英] xml no value while trying to read from google finance

查看:73
本文介绍了尝试从谷歌财务中读取时,xml没有价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

i我试图从谷歌财务中获取基本数据

i有最简单的代码才能开始工作但由于某种原因,XML的价值标签(reader.Value)总是空的,即使我点击链接(在视觉工作室)我有价值

谢谢

gil



hi everybody,
i am trying to get a basic data from Google finance
i have the most simple code just to start working but for some reason the value of the XML tag (reader.Value) is always empty even do if i click the link (in visual studio) i have values
thanks
gil

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;


namespace pivot_calculator
{
    class Program
    {
        static void Main(string[] args)
        {
            String URLString = "http://www.google.com/ig/api?stock=AAPL" ; 
            XmlTextReader reader = new XmlTextReader(URLString);
            while (reader.Read())
            {
               Console.Write(" " + reader.Name + "='" + reader.Value + "'");                

            }
        }
    }
}

推荐答案

hi Sergey ,

感谢您的回复,

i尝试使用XMLReader类,但仍然得到相同的结果值是空的

任何想法为什么?

谢谢

gil
hi Sergey,
thanks for the response,
i tried to work with the XMLReader class but still got the same results value is empty
any idea why ?
thanks
gil


这篇关于尝试从谷歌财务中读取时,xml没有价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆