筛选网址

#!/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()

 

posted @ 2014-08-16 12:17  UCanBeFree  阅读(214)  评论(0编辑  收藏  举报