def cutContent(content): ''' 剪切post获取的页面内容 ''' result = ' ' if content: start = jTool.getStrIndex('function my_init()', content) end = jTool.getStrIndex('</script>', content) if start>0 and end>0: result = jTool.getBetween(start, end, 'function my_init()', content) result = jTool.clearX(["'"], result) return result
def getEntDetail(content): ''' 根据post得到的企业详细信用记录,分解组装 以字段list方式返回(一般包含多个分类,如工商,法院) ''' start = jTool.getStrIndex('var d_obj, t_obj, r_obj;', content) end = jTool.getStrIndex('parent.putDatasAndLoad(datas);', content) recCount = 0 if start>=0 and end >=0: recordsStr = jTool.getBetween(start, end, 'var d_obj, t_obj, r_obj;', content) recCount = recordsStr.count('t_obj = d_obj.add_table(') reclist = [] for i in range(recCount): result = getEntDetailRec(recordsStr) reclist.append(result[0]) recordsStr = result[1] return reclist