????if '_charlesStatus' in rsp and rsp['_charlesStatus'] != 'Complete':
????continue
????lrsc['method'] = req['method']
????lrsc['url'] = req['url']
????headers = req['headers']
????# http head
????header_dic = list2dic(headers)
????if 'SOAPAction' in header_dic:
????lrsc['SOAPAction'] = header_dic['SOAPAction'].replace('"'?? '\"')
????if 'Referer' in header_dic:
????lrsc['Referer'] = header_dic['Referer']
????if 'Content-Type' in header_dic:
????lrsc['Content-Type'] = header_dic['Content-Type']
????if lrsc['method'] == 'GET':
????pass
????elif lrsc['method'] == 'POST':
????if 'postData' in req:
????if 'text' in req['postData']:
????lrsc['posttext'] = req['postData']['text']
????if 'params' in req['postData']:
????lrsc['postparams'] = req['postData']['params']
????if 'mimeType' in req['postData']:
????lrsc['postmime'] = req['postData']['mimeType']
????else:
????continue
????res.append(dict2lr(lrsc))
????return res
????if __name__ == '__main__':
????parse = OptionParser()
????parse.add_option("-f"?? action="store"?? dest="harfile"?? help='harfile path')
????parse.add_option("-o"?? action="store"?? dest="lrfile"?? help='action.c path')
????(options?? args) = parse.parse_args()
????if options.harfile is None or options.lrfile is None:
????parse.print_help()
????quit()
????if not os.path.exists(options.harfile):
????print('Har file %s not exist' % options.harfile)
????quit()
????res = parhar(options.harfile)
????file = open(options.lrfile?? mode='w'?? encoding='utf-8')
????for sc in res:
????file.write(sc)
????file.write(" ")
????file.close()
????print('Output to %s' % options.lrfile)
????????????????????copy??LR???????????????????????????????????????lr???????????app?????????????????????????????
????????????????δ?????????????????????????????????????????????????
????????
?????????????????????????????har??????????????????????
??????????charles?У??????web interface?????????????????charles???????????????har??????????????????д???????????????????????????????