yasserqureshi1 / Sneaker-Monitors

A collection of web monitors that notify of restocks or updates on sneaker related sites through Discord Webhook. This includes Shopify, Nike SNKRS (supports 42 countries), Supreme and now Footsite monitors!
GNU General Public License v3.0
462 stars 126 forks source link

Shopify Monitor Error "IndexError: list index out of range" #120

Open king1267 opened 2 years ago

king1267 commented 2 years ago

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:

  1. Go to '.env'
  2. 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"
  3. Run Shopifymonitor.py
  4. 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 bfbbbb

Desktop (please complete the following information):

delamae commented 2 years ago

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.

kacperkwapisz commented 2 years ago

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.

flyingymnast commented 1 year ago

Hey. Did u actually download the monitors. And they worked?