import requests
from datetime import date

result = requests.get('http://192.144.193.19:4042/api/v1/applications/app-20191112140630-0664/streaming/batches')

batchs_info = result.json()

# batchTime = '2019-11-12T07:53:44.000GMT'

log_path = "/Users/apple/Desktop/spark_streaming_log/"

today = date.today().strftime('%Y%m%d')
with open(log_path+"user_portrait_tag_name_increment_update_" + today + ".log", "a") as f:
    for batch in batchs_info:
        f.write('%s\n' % batch)