Selenium Can’t Add To Cart Eror

  python, selenium

When I try to run a selenium Scrypt on Bestbuy CANADA to Add to Cart a product it give me this error. I tried many things. I dont know what to do. Thanks you

enter image description here

Here is my code

options = webdriver.ChromeOptions()
options.add_experimental_option("useAutomationExtension", False)
options.add_experimental_option("excludeSwitches", ["enable-automation"])

PATH = (r"C:Users146Desktopchromedriver_win32chromedriver.exe")

driver = webdriver.Chrome(executable_path=PATH, chrome_options=options)

driver.get("https://www.bestbuy.ca/en-ca/product/razer-level-up-gaming-bundle-with-keyboard-mouse-mousepad/14969216?source=search&adSlot=1")

#Add to Cart
elem = driver.find_element_by_id("test")
elem.click()
time.sleep(2)

Source: Python Questions

LEAVE A COMMENT