1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-25 06:37:29 +00:00

Merge branch 'dev'

This commit is contained in:
Myned 2020-10-22 19:20:41 -04:00
commit 542ce056d4
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'
@ -72,8 +75,9 @@ class Weeb(cmds.Cog):
browser.quit() browser.quit()
self.weebing = False self.weebing = False
print('STOPPED : weebing')
await asyncio.sleep(60) await asyncio.sleep(120)
except Exception as e: except Exception as e:
tb.print_exc() tb.print_exc()