Issue
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....
Solution
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....
Answered By - undetected Selenium
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.