I am building a stock checker and need to enter a postcode into the text box on https://www.argos.co.uk/basket, but seem to have come across a hidden element that the normal sendkeys method returns an ElementNotInteractableException on. I have therefore tried using execute_script with setAttribute which runs without error, but still does not fill the text box.
from selenium import webdriver as wd
import chromedriver_binary
wd = wd.Chrome()
wd.implicitly_wait(5)
wd.get("https://www.argos.co.uk/search/ps5/category:824671/")
accept_cookies = wd.find_element_by_xpath('//*[@id="consent_prompt_submit"]')
accept_cookies.click()
add_to_cart_button = wd.find_element_by_xpath('//*[@id="findability"]/div/div[7]/div/div[5]/div[5]/div[3]/div/div/div[2]/button')
add_to_cart_button.click()
reject_insurance = wd.find_element_by_xpath('//*[@id="findability"]/div/div[3]/div/div/div[1]/footer/div/div/a')
reject_insurance.click()
wd.execute_script('document.querySelector("#basket-FulfilmentSelectorForm").setAttribute("value", "ABC123")')
Interestingly the 'delivery' button element can be interacted with as follows:
wd.execute_script('document.querySelector("#basket-FulfilmentSelectorForm-deliverButton").click()')
Any help is greatly appreciated.