筛选网址
#!/usr/bin/env python #!-*-coding=utf-8-*- import re fp=open("/home/xyt/桌面/erp_access.log","r") str=fp.readline() while str: str=fp.readline() result=re.search("\"http([a-zA-Z0-9\:\/\.])*\"",str) ignore=(r'"http://192.168.9.8:99/left.php"', r'"http://192.168.9.8:99/top.php"', r'"http://113.98.247.92:99/top.php"', r'"http://113.98.247.92:99/left.php"', r'"http://113.98.247.92:99/products.php"', r'"http://192.168.9.8:99/login.php"', r'"http://113.98.247.92:99/login.php"', r'"http://192.168.9.8:99/main.php"', r'"http://113.98.247.92:99/main.php"', ) if result!=None: if result.group() not in ignore: print result.group()