def get_items(mydivs): Best_Sellers = {} ListItems = [] BS = "" LoL_ListItems = [] Items = [] Item = 0 for track in mydivs: str_track = str(track) if ("aria-label" in str_track): print("-----------------------------------------") # Key = track['aria-label'] Key = Key.replace("Best Sellers in ", "") Key = Key.replace(" - See More", "") print(Key) # Items.append(Key) if (LoL_ListItems): if (len(LoL_ListItems) == 6): Best_Sellers[Items[Item]] = LoL_ListItems BS = Key LoL_ListItems = [] Item = Item + 1 else: if ("data-rows" in str_track and "href" in str_track): start = str_track.find("data-rows=") + len("data-rows") + 5 end = str_track.find("