日期:2014-05-17 浏览次数:20901 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
if (this.webBrowser1.ReadyState == WebBrowserReadyState.Complete && this.找到啦 != null)
{
var element = this.webBrowser1.Document.GetElementById("syncad_0");
var result = from li in element.Children.OfType<HtmlElement>()
where li.TagName == "LI"
from a in li.Children.OfType<HtmlElement>()
where a.TagName == "A"
select new ResultType
{
href = a.GetAttribute("href"),
text = a.InnerText
&