1

I have a code to automate the filling of a form. I want to wait for the user to finish reading the notice and click manually to then continue the automation

codigopostal = driver.find_element(By.NAME, 'codigoPostal')
codigopostal.clear()
codigopostal.send_keys(line[4])
time.sleep(2)
enter = driver.find_element(By.XPATH, "/html/body/div[1]/div[2]/section/form/div[2]/div[2]/table[2]/tbody/tr/td[1]/input")
enter.click() # I want to wait for the user to manually click
#continue with autofill form code....
 
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

0

To wait for the user to finish reading the notice and click manually and then continue the automation, an elegant approach would be to wait for the user to press the RETURN key on the console as follows:

codigopostal = driver.find_element(By.NAME, 'codigoPostal')
codigopostal.clear()
codigopostal.send_keys(line[4])
time.sleep(2)
enter = driver.find_element(By.XPATH, "/html/body/div[1]/div[2]/section/form/div[2]/div[2]/table[2]/tbody/tr/td[1]/input")
input('Press RETURN key when finished reading')
#continue with autofill form code....
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • thanks for your answer, this method works perfectly in console but doesnt in the webpage, i want to manually click directly over the button on webpage and continue with automation. it is not so practical to be jumping between console and webpage for each element in automation. I have read a lot with different examples such as solving a captcha manually and then continuing with the automation, etc. but I haven't found an answer – Charlie Aguirre Aug 18 '22 at 18:16