关于如何爬虫妹子图网的源码分析 c#实现
网上也出现一些抓取妹子图的python 代码,今天我们用c#实现爬虫过程。
请看我的网站: www.di81.com
private void www_94xmn_Com(string url, string urlType, int allpage, int typeID) { new Thread(() => { PublicHtml p = new PublicHtml(); CookieContainer c = new CookieContainer(); Invoke(new Action(() => { this.listBoxno.Items.Add(urlType); })); for (int i = 1; i < allpage; i++) { //GetDataGetHtml string homeurl = string.Format(url, i); string html = PubsLibrary.HttpHelper.GetDataGetHtml(homeurl, "", c); MatchCollection mcs = new Regex("(?is)(?<=\"wf-cld\").+?(?=</span></div>)").Matches(html); foreach (Match m in mcs) { WarehouseService ms = new WarehouseService();
爬取成功后就直接装入库。