Open yunusevsen opened 3 years ago
How were you able to install and get the bot to work? I have followed all the steps, downloaded the python 3.9 things and others. I double click on the bestbuybot.py and then a cmd window opens and then closes quickly, I am testing it on a product that IS in stock so I can see if it works, but I do not see any sign that it was added to cart or even if it got further than that step. Please tell me!
open a cmd window in that folder and run python3 bestbuybot.py
If its IP Based Ban, you can check by navigating on your normal browser to bestbuy and attempting adding to cart & checkout. If this results in the same error you'll need to integrate proxies. This can also be due to your account being marked on BB as potential bot. You can avoid this by adding logic to do a guest checkout instead and adding your address details to the info.py file.
If it's browser based try directing Selenium to change your user agent. Start with: https://stackoverflow.com/questions/29916054/change-user-agent-for-selenium-web-driver
Also could be that there's too many actions occurring which is triggering the anti-bot mechanism on bb. Try changing the intervals by a few seconds. This may be unfavorable though as you risk losing out on the item, maybe make them variable (a request once every ten seconds, another 15 seconds, another 11 seconds, and so forth.). See: https://www.geeksforgeeks.org/waits-in-selenium-python/
Oh and one more thing, doing some digging led me to find out more about the cookies used by BestBuy. One of them is called _abck. It is an anti-bot/anti-abuse token which is assigned to each session you create. This session lasts for four hours, and all cookies would need to be replaced at the end of four hours. If you navigate to BB website and right click -> inspect element -> find the console and enter the following document.cookie and press enter. Search for _abck in the cookie and see if you find a '~-1~' towards the end, if so you're flagged as having automated testing software. That value within _abck token should always be set to '~0~' or else you won't be able to bot on the site until another 4 hours or until it is cleared.
_abck
cookie is related to Akamai anti-bot, and is hard to bypass.
https://webscraping.wiki/docs/anti-bots/akamai/
Hii I love your code!
Im wondering if you have work-around for this?