Sneaker-Monitors
Sneaker-Monitors copied to clipboard
Shopify Monitor Error "IndexError: list index out of range"
When I run Shopify monitor using DTLR and ShoePalace's URL with /products.json at the end I get this repeated error saying "IndexError: list index out of range"
To Reproduce Steps to reproduce the behavior:
- Go to '.env'
- Replace webhook with "mywebhook", Location to "US", and URL to "https://www.dtlr.com/products.json and another to https://www.shoepalace.com/products.json"
- Run Shopifymonitor.py
- Get this error: Exception found: Traceback (most recent call last): File "C:\Users\dnmpl\Downloads\Sneaker-Monitors-master\DTLR\DTLRMonitor.py", line 199, in monitor items = scrape_site(CONFIG['URL'], proxy, headers) File "C:\Users\dnmpl\Downloads\Sneaker-Monitors-master\DTLR\DTLRMonitor.py", line 52, in scrape_site 'image': product['images'][0]['src'], IndexError: list index out of range
Screenshots
Desktop (please complete the following information):
- OS: [Windiows]
- Browser [chrome]
- Version [e.g. 22]
I imagine this is happening because one of the products in products.json doesn't have an image. To verify this, you can change the url to a products.json of a single product that does have an image, and see if it works then.
Yes, @delamae is right, the error is shown due to a product not having an image. I will let Yasser know about the issue or even commit a fix for this error.
Hey. Did u actually download the monitors. And they worked?