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.
pip install In-Stock-Py
The program below will return weather or not an item is in stock based off of keywords defined below.
importInStockPy#ceating class instancea=InStockPy.main()
#headless mode truea.headless(True)
#def in stock keywordsa.defInStockKeywords(["delivery","in stock","add to cart"])
#def out of stock keywordsa.defOutStockKeywords(["sold out","out of stock","coming soon"])
#check if in stock and print resultprint(a.checkInStock(r'https://link-to-product.com'))
#preforming final cleanupa.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.
importInStockPy#ceating class instancea=InStockPy.main()
#debug mode truea.debug(True)
#headless mode truea.headless(True)
#def in stock keywordsa.defInStockKeywords(["delivery","in stock","add to cart"])
#def out of stock keywordsa.defOutStockKeywords(["sold out","out of stock","coming soon"])
#play audio when in stocka.audioCue(True,'default')
whileTrue:
#use proxies truea.useProxy(True, r"C:\Users\proxies.txt",1)
#check if in stock and print resultprint(a.checkInStock(r'https://link-to-product.com'))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.
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.