diff --git a/shopping_test.py b/shopping_test.py index 13145d9..862bccf 100644 --- a/shopping_test.py +++ b/shopping_test.py @@ -1,7 +1,7 @@ import requests import json from bs4 import BeautifulSoup as b - +import pandas as pd params = { "callname":"GetMultipleItems", @@ -16,4 +16,12 @@ response = requests.get("https://open.api.ebay.com/shopping?", params=params) # data = response.json() pretty_data = json.dumps(data, indent=2) +df = pd.read_json(data, 'Item') +nvl = df.iloc[0]['ItemSpecifics.NameValueList'] +nvl_dict = {} +for item in nvl: + nvl['Name'] # departments = ["3034","93427"] +# Best plan of action is probably json-->pandas df. You can decide how to clean later, but it +# will prolly be easier if you clean in pandas because you can drop columns easily that you don't +# need. Figure out how to "flatten" your json data into the df first.