diff --git a/ebay_api.py b/ebay_api.py index a1031b3..9e82d96 100644 --- a/ebay_api.py +++ b/ebay_api.py @@ -45,12 +45,12 @@ class FindingApi: try:# TODO run pdb here to see how to extract itemId before update_df training = pd.read_csv('training.csv') for item in data['findItemsByCategoryResponse'][0]['searchResult'][0]['item']: - if item not in training.values not in itemid_results_list:# TODO need to figure out syntax to check if item_id is present in both list and training set. (list to avoid repeat results) + if (item not in training.values) and (item not in itemid_results_list): itemid_results_list.append(item['itemId'][0]) # itemId # values are in lists for some reason except (pd.errors.EmptyDataError, FileNotFoundError): for item in data['findItemsByCategoryResponse'][0]['searchResult'][0]['item']: - if item not in itemid_results_list: + if (item not in training.values) and (item not in itemid_results_list): itemid_results_list.append(item['itemId'][0]) item_id_results = [','.join(itemid_results_list[n:n+20]) for n in list(range(0, len(itemid_results_list), 20))]