Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

273
Visualizações
Filling a text box in an overlayed element with Selenium (Python)

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.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda