1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-11-01 21:02:38 +00:00

Fix index error

This commit is contained in:
Myned 2020-10-22 19:17:50 -04:00
parent 84d1e0d878
commit 4608d533a1
No known key found for this signature in database
GPG key ID: D42B2DAADE7D2AB5

View file

@ -31,7 +31,10 @@ class Weeb(cmds.Cog):
for item, url in urls.items(): for item, url in urls.items():
browser.get(url) browser.get(url)
status = browser.find_elements_by_css_selector('#addToCartText-product-template')[0].text try:
status = browser.find_elements_by_css_selector('#addToCartText-product-template')[0].text
except IndexError:
status = 'SOLD OUT'
if status != 'SOLD OUT': if status != 'SOLD OUT':
message += f'{item} is in stock at Switchmod!\n<{url}>\n' message += f'{item} is in stock at Switchmod!\n<{url}>\n'