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
463 stars 125 forks source link

SNKRS bot crashing #103

Closed Masterpower0255 closed 3 years ago

Masterpower0255 commented 3 years ago

Describe the bug Snkrs scrapper crashing

To Reproduce Steps to reproduce the behavior: added "headers = { "user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"}" as you said in https://github.com/yasserqureshi1/Sneaker-Monitors/issues/101

  1. Go to 'Snkrs Monitor.'
  2. change .env file to
  3. --------------------- LOCATION ---------------------

    This is your location code according to Location-Code-List.md

    LOCATION = "US"

--------------------- SNKRS BOT FEATURES ---------------------

LOC = "US" LAN = "en"

which is correct

  1. Run it
  2. See error

Expected behavior To not give this error and run properly, it crashes

*behavior received** crashes and says

Traceback (most recent call last):
  File "SNKRSmonitor.py", line 237, in <module>
    monitor()
  File "SNKRSmonitor.py", line 181, in monitor
    proxy = {"http": proxyObject.get()} if proxy_list[0] == "" else {"http": f"http://{proxy_list[proxy_no]}"}
  File "C:\Users\ID140\AppData\Local\Programs\Python\Python38\lib\site-packages\fp\fp.py", line 38, in get
    proxy_list = self.get_proxy_list()
  File "C:\Users\ID140\AppData\Local\Programs\Python\Python38\lib\site-packages\fp\fp.py", line 28, in get_proxy_list
    proxies = [f'{tr_elements[i][0].text_content()}:{tr_elements[i][1].text_content()}' for i in
  File "C:\Users\ID140\AppData\Local\Programs\Python\Python38\lib\site-packages\fp\fp.py", line 30, in <listcomp>
    if tr_elements[i][2].text_content() in self.country_id
IndexError: list index out of range

Desktop (please complete the following information):

Masterpower0255 commented 3 years ago

Fixed if i add proxies on the .env file