I'm doing scrapping on a website and want to retrieve data on the 'stats' attribute then 'interest_count' data. But I don't know how to retrieve these attributes if they are in other data. I have tried with this code
stats =p['stats.interest_count']
but failed.
the data that I'm scrapping.
source code
products = r['data']
for p in products:
name = p['name']
price = p['price']
stok = p['stock']
stats =p['stats.interest_count']
count+=1
print('No :',count, 'name :',name, 'price:',price, 'stok :', stok, 'stats :', stats)
write = csv.writer(open('{}.csv'.format(key), 'a',newline=''))
data = [nama, harga, stok]
write.writerow(data)
