Commit 549f93b7 by 岳巧源

add attr

parent 806bac94
Showing with 5 additions and 6 deletions
...@@ -133,9 +133,9 @@ def insert_pop_attr_to_db(): ...@@ -133,9 +133,9 @@ def insert_pop_attr_to_db():
password=config["mysql"]["password"]) password=config["mysql"]["password"])
cursor = db.cursor() cursor = db.cursor()
cursor.execute(query=select_sql) cursor.execute(query=select_sql)
result = cursor.fetchall() db_result = cursor.fetchall()
for i in range(len(result)): for i in range(len(db_result)):
class_id = result[i][0] class_id = db_result[i][0]
ans = get_pop_attr(class_id) ans = get_pop_attr(class_id)
result = ans["jingdong_category_read_findAttrsByCategoryIdUnlimitCate_responce"]["findattrsbycategoryidunlimitcate_result"] result = ans["jingdong_category_read_findAttrsByCategoryIdUnlimitCate_responce"]["findattrsbycategoryidunlimitcate_result"]
for j in range(len(result)): for j in range(len(result)):
...@@ -189,5 +189,4 @@ def insert_pop_attr_to_db(): ...@@ -189,5 +189,4 @@ def insert_pop_attr_to_db():
if __name__ == '__main__': if __name__ == '__main__':
ans = get_pop_attr(33593) insert_pop_attr_to_db()
print(json.dumps(ans, ensure_ascii=False)) \ No newline at end of file
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment