KeyError: 'NEW'
KTACQU opened this issue · 3 comments
KTACQU commented
Error is returned on occasion and not sure why? Sometimes runs smoothly - cant pinpoint issue other than server failure? Is there a fix for this?
price = products[i]['data']['NEW']
KeyError: 'NEW'
dehidehidehi commented
I suspect this happens because Keepa does not have any data concerning new condition prices for this product.
A fix would be to use:
price = products[i]['data'].get('NEW', list())
KTACQU commented
Hmmm, solution worked, but issue can arise at any moment, even directly after a successful pull of NEW prices
KTACQU commented
Ill close this issue, I guess for future fixes -- something to reference