查找特定的字符串
2018-01-15 本文已影响7人
KKK_air
查找项目中使用的.php 接口名
屏幕快照 2018-01-15 下午2.32.06.pngdef action():
apiurls = []
for p in paths:
if not os.path.isfile(p):
print p
break
f = open(p,'r').read()
res = re.findall('@\"(.*).php\"',f)
# print res
if res is not None and len(res) > 0:
apiurls.extend(res)
apidict = {}
for api in apiurls:
api = api.replace('%@','')
api += '.php'
apidict[api] = api
return apidict
keys = action().keys()
print len(keys)