Hi,
I am extracting historic data from a scraping website using the following code. However, I get the error 'IndexError: index 228 is out of bounds for axis 0 with size 228' at random points for different ASIN values. Please find attached the code below.
Kind Regards,
Rohit.
I am extracting historic data from a scraping website using the following code. However, I get the error 'IndexError: index 228 is out of bounds for axis 0 with size 228' at random points for different ASIN values. Please find attached the code below.
import keepa import numpy as np import pandas as pd import csv import os import datetime import requests import asyncio import json import logging import time from functools import wraps from tqdm import tqdm import aiohttp cd = os.getcwd() print(cd) accesskey = 'fvjqmcuedgtkgvtt3bk71kpf605it36ofjv1r12vj3hilhbktahtib3810ti6hdt' #enter real access key here api = keepa.Keepa(accesskey) asins = ['0553819488'] products = api.query(asins) product = products[0] # Available keys print(products[0].keys()) ASIN = products[0]['asin'] domain = products[0]['domainId'] FBA = products[0]['fbaFees'] group = products[0]['productGroup'] height = products[0]['packageHeight'] length = products[0]['packageLength'] width = products[0]['packageWidth'] weight = products[0]['packageWeight'] itemweight = products[0]['itemWeight'] category = products[0]['rootCategory'] producttype = products[0]['productType'] #prime = products[0]['isPrimeExclusive'] amazonavail = products[0]['availabilityAmazon'] #salesrank = products[0]['salesRanks'] amprice = products[0]['data']['AMAZON'] usedprice = products[0]['data']['USED'] newprice = products[0]['data']['NEW'] newpricetime = products[0]['data']['NEW_time'] print('%20s %5s %5s %5s %5s ' % ('Date', 'Price', 'AmPrice', 'ASIN', 'Domain')) for i in range(1000): print(newpricetime[i], newprice[i], amprice[i], ASIN, domain)As you can see from the code, though I am calling for the first 999 values the error is occuring at 228. Please help me on this issue.
Kind Regards,
Rohit.