本文给大家介绍的是利用Python抓取手机归属地信息,文中给出了详细的示例代码,相信对大家的理解和学习很有帮助,以下为Python代码,较为简单,供参考。
示例代码
# -*- coding:utf-8 -*-
import requests,re
o = open('data.txt','a')
e = open('error.txt','a')
baseUrl = 'http://HdhCmsTestiluohe测试数据/'
r = requests.get('http://HdhCmsTestiluohe测试数据/all.shtml',)
links = re.findall('= 300 :
e.writelines(link+"\n")
else:
cityData = cityData.content.decode("gbk").encode("utf-8")
provinceTemp = re.findall('(.*?)
查看更多关于Python抓取手机号归属地信息示例代码的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did86487