利用微信小程序作为爬虫的目标URL进行全国手机号段归属地的数据采集

"""
Version 1.1.0
Author lkk
Email lkk199404@163.com
date 2019/2/14 11:09
Desc TODO
"""
import requests
import json
import time

import toolsss

url = 'https://www.qqzeng-ip.com/api/phone'
headers = {
    "charset": "utf-8",
    'Accept-Encoding': 'gzip',
    'referer': 'https://servicewechat.com/wxa83f56a74a7a1f3a/6/page-frame.html',
    'content-type': 'application/x-www-form-urlencoded',
    'User-Agent': 'Mozilla/5.0 (Linux; Android 7.0; BLN-AL20 Build/HONORBLN-AL20; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Mobile Safari/537.36 MicroMessenger/7.0.3.1400(0x27000338) Process/appbrand0 NetType/WIFI Language/zh_CN',
    'Content-Length': '13',
    'Host': 'www.qqzeng-ip.com',
    'Connection': 'Keep-Alive',
}

for i in range(3,10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                for y in range(10):
                    for t in range(10):
                        number = str(1)+(str(i)+str(j)+str(k)+str(l)+str(y)+str(t))
                        data = {
                            'phone': number
                        }
                        s = requests.session()
                        response = s.post(url, data=data, headers=headers)
                        res = json.loads(response.text)
                        if res.get('isp') == '格式不对':
                            pass
                        # elif res.get('data').get('province') == '您的':
                        #     IP = input('更换IP')
                        #     pass
                        else:
                            province = res.get('data').get('province')
                            city = res.get('data').get('city')
                            isp = res.get('data').get('isp')
                            postcode = res.get('data').get('postcode')
                            citycode = res.get('data').get('citycode')
                            areacode = res.get('data').get('areacode')
                            version = res.get('data').get('version')
                            # toolsss.mysql(number, province, city, isp, postcode, citycode, areacode, version)
                            print(number, province, city, isp, postcode, citycode, areacode, version)

微信小程序入口为

最新手机号段归属地数据库 

最新 手机号段数据库 号码归属地数据库 移动号段 联通号段 电信号段 虚拟运营商

移动号段:134,135,136,137,138,139,147,148,150,151,152,157,158,159,172,178,182,183,184,187,188,198

联通号段:130,131,132,145,146,155,156,166,171,175,176,185,186

电信号段:133,149,153,173,174,177,180,181,189,199

虚拟运营商:170

数据库部分数据

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值