using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
namespace 职位信息提取
{
class Program
{
static void Main(string[] args)
{
List strList = new List();
string strP = File.ReadAllText("前程无忧.htm",Encoding.Default);
MatchCollection ms = Regex.Matches(strP,"class=\"jobname\" target=\"_blank\">(.+)");
for (int i = 0; i < ms.Count;i++ )
{
if (ms[i].Success)
{
strList.Add(ms[i].Groups[1].Value);
}
}
File.WriteAllLines(@"职位统计.txt", strList.ToArray());
Console.WriteLine("OK");
Console.ReadKey();
}
}
}
转载于:https://blog.51cto.com/net5x/1584837