1、下载 DLL http://pan.baidu.com/s/1eQfgMWU
2、示例代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace QA.Base.Extention.Test
{
class Program
{
static void Main(string[] args)
{
// WebClient client = new WebClient();
// var htmlByte = client.DownloadData("http://item.jd.com/690912.html");
var html = "<html><head></head><body><div id=\"shortcut-2014\"><span id='ttbar-login'><input id='sda' /></span></div></body></html>";//client.Encoding.GetString(htmlByte);
var tmp = html.GetElementById("shortcut-2014")
.GetElementById("ttbar-login");
Console.WriteLine(tmp);
tmp = html.GetElementById("shortcut-2014")
.GetElementById("sda");
Console.WriteLine(tmp);
Console.Read();
}
}
}
2、示例代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace QA.Base.Extention.Test
{
class Program
{
static void Main(string[] args)
{
// WebClient client = new WebClient();
// var htmlByte = client.DownloadData("http://item.jd.com/690912.html");
var html = "<html><head></head><body><div id=\"shortcut-2014\"><span id='ttbar-login'><input id='sda' /></span></div></body></html>";//client.Encoding.GetString(htmlByte);
var tmp = html.GetElementById("shortcut-2014")
.GetElementById("ttbar-login");
Console.WriteLine(tmp);
tmp = html.GetElementById("shortcut-2014")
.GetElementById("sda");
Console.WriteLine(tmp);
Console.Read();
}
}
}
