I need to register a lot of people in a company's system but there's a captcha in the login screen that I want to solve it manually before running the script to automatically fill the data in the system. Is there any way to make the webdriver "wait" for me to solve the captcha and then continue to run the script (find the XPaths and fill the data in)?
CodePudding user response:
try using driver.wait.until(ExpectedCondition.element_to_be_clickable((By.XPATH, "myXpath"))).click() for the button. try to add the screenshot or link of the web page
CodePudding user response:
I would use keyboard input. Add a while True loop which breaks when you enter a keyboard combination.
import time
import keyboard
""" Script until captcha """
print('Stopping script for captcha.\nPress "ctrl shift x" to continue script')
while True:
if keyboard.is_pressed("ctrl shift x"):
print('Script will continue in 2 seconds :)')
time.sleep(2)
break
""" Rest of script """