lafaso.com数据获取
private void button31_Click(object sender, EventArgs e)
{
GetHtmlNodeFromLink2("http://www.lafaso.com/clothing/", "UTF-8");//http://www.vancl.com/channel/women.html children
HtmlAgilityPack.HtmlNodeCollection node = htmlNodes.SelectNodes("//div[@class='clothing_new clothing_moban']/textarea/ul/li");//"//div[@class='slideBannerA homeSlideAD1']"
strLink = new string[node.Count];
strImgSrc = new string[node.Count];
strTitle = new string[node.Count];
strMarketPrice = new string[node.Count];
strCurrentPrice = new string[node.Count];
int i = 0;
foreach (HtmlNode htmlNode in node)
{
try
{
strLink[i] = htmlNode.ChildNodes[0].Attributes["href"].Value;
strImgSrc[i] = htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value;// == null ? htmlNode.ChildNodes[0].ChildNodes[0].Attributes["original"].Value : htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value; ;
strTitle[i] = htmlNode.ChildNodes[1].ChildNodes[0].ChildNodes[0].InnerHtml.Trim();
//strMarketPrice[i] = htmlNode.ChildNodes[3].ChildNodes[3].InnerHtml.Trim().Replace("¥", "").Replace("¥", "");
strCurrentPrice[i++] = htmlNode.ChildNodes[2].ChildNodes[0].ChildNodes[0].InnerHtml.Trim().Replace("乐蜂价:¥", "");
}
catch
{ }
}
}
private void button32_Click(object sender, EventArgs e)
{
GetHtmlNodeFromLink2("http://www.lafaso.com/clothing/", "UTF-8");//http://www.vancl.com/channel/women.html children
HtmlAgilityPack.HtmlNodeCollection node = htmlNodes.SelectNodes("//div[@class='clothing_new clothing_shirt clothing_kz clothing_moban']/textarea/ul/li");//"//div[@class='slideBannerA homeSlideAD1']"
//clothing_new clothing_shirt clothing_moban
strLink = new string[node.Count];
strImgSrc = new string[node.Count];
strTitle = new string[node.Count];
strMarketPrice = new string[node.Count];
strCurrentPrice = new string[node.Count];
int i = 0;
foreach (HtmlNode htmlNode in node)
{
try
{
strLink[i] = htmlNode.ChildNodes[0].Attributes["href"].Value;
strImgSrc[i] = htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value;// == null ? htmlNode.ChildNodes[0].ChildNodes[0].Attributes["original"].Value : htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value; ;
strTitle[i] = htmlNode.ChildNodes[1].ChildNodes[0].ChildNodes[0].InnerHtml.Trim();
//strMarketPrice[i] = htmlNode.ChildNodes[3].ChildNodes[3].InnerHtml.Trim().Replace("¥", "").Replace("¥", "");
strCurrentPrice[i++] = htmlNode.ChildNodes[2].ChildNodes[0].ChildNodes[0].InnerHtml.Trim().Replace("乐蜂价:¥", "");
}
catch
{ }
}
}
private void button33_Click(object sender, EventArgs e)
{
GetHtmlNodeFromLink2("http://www.lafaso.com/clothing/", "UTF-8");//http://www.vancl.com/channel/women.html children
HtmlAgilityPack.HtmlNodeCollection node = htmlNodes.SelectNodes("//div[@class='clothing_new clothing_shirt clothing_moban']/textarea/ul/li");//"//div[@class='slideBannerA homeSlideAD1']"
//
strLink = new string[node.Count];
strImgSrc = new string[node.Count];
strTitle = new string[node.Count];
strMarketPrice = new string[node.Count];
strCurrentPrice = new string[node.Count];
int i = 0;
foreach (HtmlNode htmlNode in node)
{
try
{
strLink[i] = htmlNode.ChildNodes[0].Attributes["href"].Value;
strImgSrc[i] = htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value;// == null ? htmlNode.ChildNodes[0].ChildNodes[0].Attributes["original"].Value : htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value; ;
strTitle[i] = htmlNode.ChildNodes[1].ChildNodes[0].ChildNodes[0].InnerHtml.Trim();
//strMarketPrice[i] = htmlNode.ChildNodes[3].ChildNodes[3].InnerHtml.Trim().Replace("¥", "").Replace("¥", "");
strCurrentPrice[i++] = htmlNode.ChildNodes[2].ChildNodes[0].ChildNodes[0].InnerHtml.Trim().Replace("乐蜂价:¥", "");
}
catch
{ }
}
}
private void button34_Click(object sender, EventArgs e)
{
GetHtmlNodeFromLink2("http://www.lafaso.com/clothing/", "UTF-8");//http://www.vancl.com/channel/women.html children
HtmlAgilityPack.HtmlNodeCollection node = htmlNodes.SelectNodes("//div[@class='clothing_new clothing_shirt clothing_moban']/textarea/p");//"//div[@class='slideBannerA homeSlideAD1']"
//
strLink = new string[node.Count];
strImgSrc = new string[node.Count];
strTitle = new string[node.Count];
strMarketPrice = new string[node.Count];
strCurrentPrice = new string[node.Count];
int i = 0;
foreach (HtmlNode htmlNode in node)
{
try
{
strLink[i] = htmlNode.ChildNodes[0].Attributes["href"].Value;
strImgSrc[i++] = htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value;// == null ? htmlNode.ChildNodes[0].ChildNodes[0].Attributes["original"].Value : htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value; ;
//strTitle[i] = htmlNode.ChildNodes[1].ChildNodes[0].ChildNodes[0].InnerHtml.Trim();
//strMarketPrice[i] = htmlNode.ChildNodes[3].ChildNodes[3].InnerHtml.Trim().Replace("¥", "").Replace("¥", "");
//strCurrentPrice[i] = htmlNode.ChildNodes[2].ChildNodes[0].ChildNodes[0].InnerHtml.Trim().Replace("乐蜂价:¥", "");
}
catch
{ }
}
}
private void button35_Click(object sender, EventArgs e)
{
GetHtmlNodeFromLink2("http://www.lafaso.com/clothing/", "UTF-8");//http://www.vancl.com/channel/women.html children
HtmlAgilityPack.HtmlNodeCollection node = htmlNodes.SelectNodes("//div[@class='clothing_new clothing_shirt clothing_kz clothing_moban']/textarea/p");//"//div[@class='slideBannerA homeSlideAD1']"
//
strLink = new string[node.Count];
strImgSrc = new string[node.Count];
strTitle = new string[node.Count];
strMarketPrice = new string[node.Count];
strCurrentPrice = new string[node.Count];
int i = 0;
foreach (HtmlNode htmlNode in node)
{
try
{
strLink[i] = htmlNode.ChildNodes[0].Attributes["href"].Value;
strImgSrc[i++] = htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value;// == null ? htmlNode.ChildNodes[0].ChildNodes[0].Attributes["original"].Value : htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value; ;
//strTitle[i] = htmlNode.ChildNodes[1].ChildNodes[0].ChildNodes[0].InnerHtml.Trim();
//strMarketPrice[i] = htmlNode.ChildNodes[3].ChildNodes[3].InnerHtml.Trim().Replace("¥", "").Replace("¥", "");
//strCurrentPrice[i] = htmlNode.ChildNodes[2].ChildNodes[0].ChildNodes[0].InnerHtml.Trim().Replace("乐蜂价:¥", "");
}
catch
{ }
}
}
{
GetHtmlNodeFromLink2("http://www.lafaso.com/clothing/", "UTF-8");//http://www.vancl.com/channel/women.html children
HtmlAgilityPack.HtmlNodeCollection node = htmlNodes.SelectNodes("//div[@class='clothing_new clothing_moban']/textarea/ul/li");//"//div[@class='slideBannerA homeSlideAD1']"
strLink = new string[node.Count];
strImgSrc = new string[node.Count];
strTitle = new string[node.Count];
strMarketPrice = new string[node.Count];
strCurrentPrice = new string[node.Count];
int i = 0;
foreach (HtmlNode htmlNode in node)
{
try
{
strLink[i] = htmlNode.ChildNodes[0].Attributes["href"].Value;
strImgSrc[i] = htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value;// == null ? htmlNode.ChildNodes[0].ChildNodes[0].Attributes["original"].Value : htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value; ;
strTitle[i] = htmlNode.ChildNodes[1].ChildNodes[0].ChildNodes[0].InnerHtml.Trim();
//strMarketPrice[i] = htmlNode.ChildNodes[3].ChildNodes[3].InnerHtml.Trim().Replace("¥", "").Replace("¥", "");
strCurrentPrice[i++] = htmlNode.ChildNodes[2].ChildNodes[0].ChildNodes[0].InnerHtml.Trim().Replace("乐蜂价:¥", "");
}
catch
{ }
}
}
private void button32_Click(object sender, EventArgs e)
{
GetHtmlNodeFromLink2("http://www.lafaso.com/clothing/", "UTF-8");//http://www.vancl.com/channel/women.html children
HtmlAgilityPack.HtmlNodeCollection node = htmlNodes.SelectNodes("//div[@class='clothing_new clothing_shirt clothing_kz clothing_moban']/textarea/ul/li");//"//div[@class='slideBannerA homeSlideAD1']"
//clothing_new clothing_shirt clothing_moban
strLink = new string[node.Count];
strImgSrc = new string[node.Count];
strTitle = new string[node.Count];
strMarketPrice = new string[node.Count];
strCurrentPrice = new string[node.Count];
int i = 0;
foreach (HtmlNode htmlNode in node)
{
try
{
strLink[i] = htmlNode.ChildNodes[0].Attributes["href"].Value;
strImgSrc[i] = htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value;// == null ? htmlNode.ChildNodes[0].ChildNodes[0].Attributes["original"].Value : htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value; ;
strTitle[i] = htmlNode.ChildNodes[1].ChildNodes[0].ChildNodes[0].InnerHtml.Trim();
//strMarketPrice[i] = htmlNode.ChildNodes[3].ChildNodes[3].InnerHtml.Trim().Replace("¥", "").Replace("¥", "");
strCurrentPrice[i++] = htmlNode.ChildNodes[2].ChildNodes[0].ChildNodes[0].InnerHtml.Trim().Replace("乐蜂价:¥", "");
}
catch
{ }
}
}
private void button33_Click(object sender, EventArgs e)
{
GetHtmlNodeFromLink2("http://www.lafaso.com/clothing/", "UTF-8");//http://www.vancl.com/channel/women.html children
HtmlAgilityPack.HtmlNodeCollection node = htmlNodes.SelectNodes("//div[@class='clothing_new clothing_shirt clothing_moban']/textarea/ul/li");//"//div[@class='slideBannerA homeSlideAD1']"
//
strLink = new string[node.Count];
strImgSrc = new string[node.Count];
strTitle = new string[node.Count];
strMarketPrice = new string[node.Count];
strCurrentPrice = new string[node.Count];
int i = 0;
foreach (HtmlNode htmlNode in node)
{
try
{
strLink[i] = htmlNode.ChildNodes[0].Attributes["href"].Value;
strImgSrc[i] = htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value;// == null ? htmlNode.ChildNodes[0].ChildNodes[0].Attributes["original"].Value : htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value; ;
strTitle[i] = htmlNode.ChildNodes[1].ChildNodes[0].ChildNodes[0].InnerHtml.Trim();
//strMarketPrice[i] = htmlNode.ChildNodes[3].ChildNodes[3].InnerHtml.Trim().Replace("¥", "").Replace("¥", "");
strCurrentPrice[i++] = htmlNode.ChildNodes[2].ChildNodes[0].ChildNodes[0].InnerHtml.Trim().Replace("乐蜂价:¥", "");
}
catch
{ }
}
}
private void button34_Click(object sender, EventArgs e)
{
GetHtmlNodeFromLink2("http://www.lafaso.com/clothing/", "UTF-8");//http://www.vancl.com/channel/women.html children
HtmlAgilityPack.HtmlNodeCollection node = htmlNodes.SelectNodes("//div[@class='clothing_new clothing_shirt clothing_moban']/textarea/p");//"//div[@class='slideBannerA homeSlideAD1']"
//
strLink = new string[node.Count];
strImgSrc = new string[node.Count];
strTitle = new string[node.Count];
strMarketPrice = new string[node.Count];
strCurrentPrice = new string[node.Count];
int i = 0;
foreach (HtmlNode htmlNode in node)
{
try
{
strLink[i] = htmlNode.ChildNodes[0].Attributes["href"].Value;
strImgSrc[i++] = htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value;// == null ? htmlNode.ChildNodes[0].ChildNodes[0].Attributes["original"].Value : htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value; ;
//strTitle[i] = htmlNode.ChildNodes[1].ChildNodes[0].ChildNodes[0].InnerHtml.Trim();
//strMarketPrice[i] = htmlNode.ChildNodes[3].ChildNodes[3].InnerHtml.Trim().Replace("¥", "").Replace("¥", "");
//strCurrentPrice[i] = htmlNode.ChildNodes[2].ChildNodes[0].ChildNodes[0].InnerHtml.Trim().Replace("乐蜂价:¥", "");
}
catch
{ }
}
}
private void button35_Click(object sender, EventArgs e)
{
GetHtmlNodeFromLink2("http://www.lafaso.com/clothing/", "UTF-8");//http://www.vancl.com/channel/women.html children
HtmlAgilityPack.HtmlNodeCollection node = htmlNodes.SelectNodes("//div[@class='clothing_new clothing_shirt clothing_kz clothing_moban']/textarea/p");//"//div[@class='slideBannerA homeSlideAD1']"
//
strLink = new string[node.Count];
strImgSrc = new string[node.Count];
strTitle = new string[node.Count];
strMarketPrice = new string[node.Count];
strCurrentPrice = new string[node.Count];
int i = 0;
foreach (HtmlNode htmlNode in node)
{
try
{
strLink[i] = htmlNode.ChildNodes[0].Attributes["href"].Value;
strImgSrc[i++] = htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value;// == null ? htmlNode.ChildNodes[0].ChildNodes[0].Attributes["original"].Value : htmlNode.ChildNodes[0].ChildNodes[0].Attributes["src"].Value; ;
//strTitle[i] = htmlNode.ChildNodes[1].ChildNodes[0].ChildNodes[0].InnerHtml.Trim();
//strMarketPrice[i] = htmlNode.ChildNodes[3].ChildNodes[3].InnerHtml.Trim().Replace("¥", "").Replace("¥", "");
//strCurrentPrice[i] = htmlNode.ChildNodes[2].ChildNodes[0].ChildNodes[0].InnerHtml.Trim().Replace("乐蜂价:¥", "");
}
catch
{ }
}
}
作者:Bober Song
出处:http://bober.cnblogs.com/
CARE健康网: http://www.aicareyou.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
出处:http://bober.cnblogs.com/
CARE健康网: http://www.aicareyou.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。