java获取qq邮箱的网络爬虫

时间:2014-11-19 12:17:13   收藏:0   阅读:396

 

代码如下

package Game;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    public static void main(String[] args) throws IOException {
        File file=new File("D:\\index.html");
        BufferedReader buf=new BufferedReader(new InputStreamReader(new FileInputStream(file)));
        String str=null;
        String regex="(.)+@(.)+(\\.[a-z]+){1,}";
        Pattern pattern=Pattern.compile(regex);
        while((str=buf.readLine())!=null)
        {
            Matcher matcher=pattern.matcher(str);
            while(matcher.find())
            System.out.println(matcher.group());
        }
        buf.close();

    }
}

  详细说明:http://java.662p.com/thread-3731-1-1.html

原文:http://www.cnblogs.com/liniuzen/p/4107842.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!