Using InStockPy, you can check weather any item is in stock by using keywords to determine if an item is in stock. InStockPy has support for proxies to bypass anti bot protection. - InStockPy *
pip install In-Stock-Py
Class creation example a = InStockPy.main()
Debug mode needs to be called before any other function in order for it
to work a.debug(<Bool>)
Set this to true if you dont want to see the chrome window when the
script is checking an item. a.headless(<Bool>)
Put keyword here that mean an item is in stock.
a.defInStockKeywords(["add to cart","in stock"])
Put keyword here that mean an item is out of stock.
a.defInStockKeywords(["unavaliable","out of stock"])
Set path to 'default' if you want to use the default sound.
a.audioCue(<Bool>,'C:\path\to\mp3')
a.useProxy(<Bool>, r"C:\path\to\prox.txt",<int [amount of times to reuse proxy]>)
Set link that you want to check. Returns , True = In Stock, False = Out
of stock, None = no keywords found on page
a.checkInStock(r'https://link-to-product.com')
a.cleanup()
Closes webdriver, open threads, etc.
The program below will return weather or not an item is in stock based off of keywords defined below.
import InStockPy
#ceating class instance
a = InStockPy.main()
#headless mode true
a.headless(True)
#def in stock keywords
a.defInStockKeywords(["delivery","in stock","add to cart"])
#def out of stock keywords
a.defOutStockKeywords(["sold out","out of stock","coming soon"])
#check if in stock and print result
print(a.checkInStock(r'https://link-to-product.com'))
#preforming final cleanup
a.cleanup()
The usage below uses a while true loop to check if an item is in stock forever. It uses proxys to bypass bot protection and plays an alarm sound when it is in stock.
import InStockPy
#ceating class instance
a = InStockPy.main()
#debug mode true
a.debug(True)
#headless mode true
a.headless(True)
#def in stock keywords
a.defInStockKeywords(["delivery","in stock","add to cart"])
#def out of stock keywords
a.defOutStockKeywords(["sold out","out of stock","coming soon"])
#play audio when in stock
a.audioCue(True,'default')
while True:
#use proxies true
a.useProxy(True, r"C:\Users\proxies.txt",1)
#check if in stock and print result
print(a.checkInStock(r'https://link-to-product.com'))
Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change. Add me on discord
Zexter#0323
Please make sure to update tests as appropriate.