BestBuy-Automated-Checkout
BestBuy-Automated-Checkout copied to clipboard
What will happen if multiple items are listed with the SKU search?
I thought I would try and use this to try and buy a new Xbox for my son for Xmas as I have had no luck trying to do it the 'normal' way.
The search for the SKU (6428324) results in several items (some are bundles), will the script cope with this and only buy the fist item?
Thanks
As the bot is designed now it won’t be able to, but this is a good idea to add. I will look into this next day off from work I get
@macdat What is the desired behavior in this scenario? I can take a look.
Well for me it would be to buy the first item in the list.... perhaps it could work by setting the price of the item to purchase ?
@macdat Give me a few hours, busy at the momen. There's a better way to lookup the items by redirecting the url to the desired sku, not by using the search bar mech.
I found another one called 'Bird Bot' that seems to work that way.
I also read that most sites are blocking bots anyway so I doubt its going to work.
@macdat Here you go.
def searchtag(self, search_tag):
sku = search_tag
product_url = "https://www.bestbuy.com/site/product/{sku1}.p?skuId={sku2}".format(sku1=sku,sku2=sku)
print(product_url)
self.driver.get(product_url)
time.sleep(5)
Instead of placing the SKU into the search bar, this redirects the user to the desired product page after login. It does this by formatting the URL with the SKU, building the product URL, and redirecting the browser to it. It then begins the same process for checking if the product is in stock.
Also, lets not "Doubt" others simply trying to help you in their free time 👍 Hope this helps you in your endeavors for an Xbox this holiday season.
@Konyanj0278 Created pull request here #6