import re #导入正则
a = "\d+.\d+.\d+.\d+" #设置匹配ip地址规则
b = re.compile(a) #编译
c = b.findall(ip) #匹配
print c
以下是爬虫部分:
req = urllib2.urlopen("http://192.168.1.1:8080/?action=stream")
buf = req.read(71) #数据头图片长度
import re #导入正则
a = "\d+.\d+.\d+.\d+" #设置匹配ip地址规则
b = re.compile(a) #编译
c = b.findall(ip) #匹配
print c
以下是爬虫部分:
req = urllib2.urlopen("http://192.168.1.1:8080/?action=stream")
buf = req.read(71) #数据头图片长度