C#简单爬虫案例
2017-10-10 10:06
218 查看
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { WebClient wc = new WebClient(); wc.Encoding = Encoding.UTF8; string html = wc.DownloadString("http://www.lagou.com/"); MatchCollection matches = Regex.Matches(html, "<a.*jobs.*>(.*)</a>"); foreach (Match item in matches) { Console.WriteLine(item.Groups[1].Value); } Console.WriteLine(matches.Count); Console.ReadKey(); } } }
相关文章推荐
- C#简单爬虫案例分享
- C#简单的委托案例
- C#局域网下的简单即时通讯案例
- 爬虫技术 -- 进阶学习(七)简单爬虫抓取示例(附c#代码)
- 学习爬虫基础5-一个简单的小案例
- 简单干净的C#方法设计案例:SFCUI.AjaxLoadPage()之二
- python简单爬虫案例(二十一)
- HtmlUnit 爬虫简单案例——模拟登陆CSDN
- 爬虫技术(四)-- 简单爬虫抓取示例(附c#代码)
- 简单干净的C#方法设计案例:SFCUI.AjaxLoadPage()之二
- 开源一个C#写的小爬虫,简单实用
- c#创建调用bat文件简单案例
- java爬虫 京东商品页 简单案例
- C#简单爬虫核心代码
- 简单干净的C#方法设计案例:SFCUI.AjaxValue()之二
- C# Socket实现简单控制台案例
- 简单干净的C#方法设计案例:SFCUI.AjaxLoadPage()之二
- C#简单实现在网页上发邮件的案例
- 爬虫 scrapy 框架学习 1. Scrapy框架业务逻辑的理解 + 简单爬虫案例示范
- 适合C# Actor的消息执行方式(5):一个简单的网络爬虫