from commons.conn_mysql import MySQLPoolOnline import time def get_data(): date_str = time.strftime("%Y-%m-%d", time.localtime()) db_online = MySQLPoolOnline() sql = """ select platform_id,count(1) from retrieve_scrape_data where scrape_date = %s GROUP BY platform_id """ data_list = db_online.select_data(sql, (date_str,)) print(data_list) if __name__ == '__main__': get_data()