BestBuy-Automated-Checkout icon indicating copy to clipboard operation
BestBuy-Automated-Checkout copied to clipboard

What will happen if multiple items are listed with the SKU search?

Open macdat opened this issue 4 years ago • 6 comments

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?

image

Thanks

macdat avatar Nov 16 '20 21:11 macdat

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

Konyanj0278 avatar Nov 16 '20 22:11 Konyanj0278

@macdat What is the desired behavior in this scenario? I can take a look.

kmedeiros95 avatar Nov 17 '20 21:11 kmedeiros95

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 avatar Nov 17 '20 22:11 macdat

@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.

kmedeiros95 avatar Nov 17 '20 22:11 kmedeiros95

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 avatar Nov 17 '20 23:11 macdat

@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

kmedeiros95 avatar Nov 18 '20 00:11 kmedeiros95