需求
公司app有个模块,需要做手机号段检索,便于导入指定市的电话

参考第三方网站:http://m.jihaoba.com/tools/haoduan/
利用scrapy框架,爬取城市和号段,存入数据库,数据结构:
create table `fcxlt_fans_data`(
`id` bigint NOT NULL AUTO_INCREMENT,
`city_id` int(11) NOT NULL,
`segment_num_3` char(3) not null ,
`segment_num_7` mediumtext not null ,
primary key (`id`),
key `city_id` (`city_id`) using btree
) engine =innodb auto_increment=1 default charset=utf8mb4
phones.py
# -*- coding

本文介绍如何使用Scrapy框架,针对http://m.jihaoba.com/tools/haoduan/网站,爬取不同城市的手机号段信息,并详细说明了数据结构、存储到数据库以及保存为JSON文档的实现过程。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



