*
* @param htmlSource
* @return
*/
public static String parseMobileFrom(String htmlSource){
Pattern p1 = null;
Matcher m1 = null;
String result = null;
// StringBuffer sb = new StringBuffer();
htmlSource = htmlSource.replaceAll("<!--.*?-->","");
p1 = Pattern.compile(REGEX_GET_MOBILE);
m1 = p1.matcher(htmlSource);
if(m1.find()){
System.out.println(m1.group(1)+","+m1.group(2).replace(" ", ",")+","+m1.group(3));
}
return result;
}
/**
* 验证手机号
* @param mobileNumber
* @return
*/
public static boolean veriyMobile(String mobileNumber){
Pattern p=null;
Matcher m=null;
p=Pattern.compile(REGEX_IS_MOBILE);
m=p.matcher(mobileNumber);
return m.matches();
}
/**
* 测试
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
try{
BufferedReader br = new BufferedReader(new FileReader("tel7.data"));
String s = null;
String info = null;
while((s = br.readLine()) != null){
Thread.sleep(1000*20);
info = getMobileFrom(s);
System.out.println(info);
BufferedWriter bw = new BufferedWriter(new FileWriter("phoneinfo.data",true));
bw.write("\n"+info);
bw.flush();
bw.close();
}
br.close();
}catch(Exception e){
e.printStackTrace();
} }
}
公司里用的代理器是CCProxy.v6.5.0这个,但是我不知道怎么在我的代码里调用代理,怎么设置才能用
------解决方案--------------------
顶,不知道哦