C#从网页表中获取数据 [英] C# Fetching data from a table of a webpage

查看:84
本文介绍了C#从网页表中获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个结果,以便从结果网页中获取学生的分数



这是我使用的代码

Hi, I am developing a result to fetch marks of student from a Result Webpage

Here is the code I am using

string url = "http://results3.indiaresults.com/jk/jkbose/class-10th-annual-regular-exam-result-kashmir-div-2015/result.asp?rollno=8115253";
            var w = new HtmlAgilityPack.HtmlWeb();
            HtmlAgilityPack.HtmlDocument doc = w.Load(url);
           
          string text=  doc.DocumentNode.SelectSingleNode("//*[@id='table106']/tbody/tr[20]/td[2]/b/font").InnerText;
            richTextBox1.Text = text;


我面临的问题是它返回NullReferenceException

我认为这可能是因为15秒广告弹出窗口加载。



请帮助



这是一个网页示例

http://1drv.ms/1Pncmsx


The problem I am facing is it return NullReferenceException
I think it might be because of the 15 second advertise that pop ups on load.

Please help

Here is a sample of the webpage
http://1drv.ms/1Pncmsx

推荐答案

你的问题与asp.net/web技术有关,为了更好的支持,请将你的问题
发布到下面的asp.net论坛,这个论坛适用于C#具体的代码问题:


http://forums.asp.net/

最好的问候,

Kristin


这篇关于C#从网页表中获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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