python抓取html中的手机号
程序员文章站
2022-06-10 23:14:14
...
#! /usr/bin/python
import urllib, re
regex=r"1[3|4|5|7|8]\d{9}"
response = urllib.urlopen('http://www.qnelec.com/contact.aspx')
html = response.read()
#html = html.decode('utf-8')
#print(html)
qqlist = re.findall(regex,html)
qqlist=list(set(qqlist))
i = 0
for qq in qqlist:
i += 1
if i < 16:
print("{} :{}".format(i,qq))
qq:regex=r"[1-9][\d]{5,9}"
import urllib, re
regex=r"1[3|4|5|7|8]\d{9}"
response = urllib.urlopen('http://www.qnelec.com/contact.aspx')
html = response.read()
#html = html.decode('utf-8')
#print(html)
qqlist = re.findall(regex,html)
qqlist=list(set(qqlist))
i = 0
for qq in qqlist:
i += 1
if i < 16:
print("{} :{}".format(i,qq))
qq:regex=r"[1-9][\d]{5,9}"
上一篇: Android自学简历书写
下一篇: python:面向对象(类)