PY爬虫-抓取手机号,实现访客手机号码采集获取

时间: 作者: 点击量:
PY爬虫-抓取手机号,实现访客手机号码采集获取.抓取手机号,手机号抓取,访客手机号码采集,访客手机号码获取,访客手机号抓取.

某网站论坛上有大量用户留下手机号,写个简单的爬虫就可以获取。
⚠️友情提醒:个人信息安全需保密,否则很容易被不法分子窃取。

crawler.py

import requests
import urllib2
import urllib
import hashlib
import json
import re
import sys
import getopt
import time

def getInfoByInput(input):
    regex_email = re.compile(r"\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b", re.IGNORECASE)
    regex_phone = re.compile(r"1[3|4|5|7|8]\d{9}\b", re.IGNORECASE)
    result = {}
    result['email'] = re.findall(regex_email, input)
    result['phone'] = re.findall(regex_phone, input)
    return result

def write_to_file(out_file_path,content):
filter.py

import io
def filter(infile,outfile):
    infopen = io.open(infile,'r',encoding='utf-8')
    outopen = io.open(outfile,'w',encoding='utf-8')
    lines = infopen.readlines()
    list_1 = []
    for line in lines:
        if line not in list_1:
            list_1.append(line)
            outopen.write(line)
    infopen.close()
    outopen.close()
filter("crawl.txt","result.txt")


上一篇:网站访客电话(手机号码)如何获取分析

下一篇:没有了

注册体验: