日期:2014-05-17  浏览次数:20806 次

C#如何从获取到的网页内容中抓取自己想要的部分?
假设抓取到的网页内容如下:

<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<html>
<head>
<title>
研究生院信息系统
-&gt;
查看考试成绩

</title>

    <link href="/media/default/css/default.css" rel="stylesheet" type="text/css">


    <link href="/media/default/css/customize.css" rel="stylesheet" type="text/css">


<script language="JavaScript" src="/js/css_expression.js"></script>
<script language="JavaScript" src="/js/util.js"></SCRIPT>
<script language="JavaScript" src="/js/usecalendar.js"></SCRIPT>

    <script language="JavaScript" src="/js/customize.js"></script>





</head>
<body>
<br>


<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" class="list_RoundTitle" title="查看考试成绩">

<tr>
    <td width="20%">学号:
    1111111111
    </td>
    <td width="15%">姓名:
    张三
    </td>
    <td>课程编号:
    0000001
    </td>
</tr>

</table>
<table cellpadding="0" cellspacing="0" border="0" width="98%" align="center">
<tr>
    <td align="top">
    
        
        
           <!-- 显示找到结果  -->
           
<table width="100%" cellpadding="4" class="list_caption_change_mouse" align="center" cellspacing="1" border="0" id="row">
<thead>
<tr>
<th width="7%" class="sortable" align="left">
<a href="queryDepartmentAction.do?d-16544-s=0&amp;studentid=xdleess20120514sn0727&amp;degreecourseno=0022001&amp;d-16544-o=2&amp;d-16544-p=1">上课学期</a></th>
<th width="16%" class="sortable" align="left">
<a href="queryDepartmentAction.do?d-16544-s=1&amp;studentid=xdleess20120514sn0727&amp;degreecourseno=0022001&amp;d-16544-o=2&amp;d-16544-p=1">课程名称</a></th>
<th width="4%" class="sortable" align="left">
<a href="queryDepartmentAction.do?d-16544-s=2&amp;studentid=xdleess20120514sn0727&amp;degreecourseno=0022001&amp;d-16544-o=2&amp;d-16544-p=1">学分</a></th>
<th width="14%" class="sortable" align="left">
<a href="queryDepartmentAction.do?d-16544-s=3&amp;studentid=xdleess20120514sn0727&amp;degreecourseno=0022001&amp;d-16544-o=2&amp;d-16544-p=1">任课教师</a></th>
<th width="7%" class="sortable" align="left">
<a href="queryDepartmentAction.do?d-16544-s=4&amp;studentid=xdleess20120514sn0727&amp;degreecourseno=0022001&amp;d-16544-o=2&amp;d-16544-p=1">总评成绩</a></th>
<th width="7%" class="sortable" align="left">
<a href="queryDepartmentAction.do?d-16544-s=5&amp;studentid=xdleess