I have a bot that automates a site, I want the code to show the website for the user to solve a captcha and then switch to headless. This is my attempt:
from selenium import webdriver
from time import sleep
import undetected_chromedriver as uc
from selenium.webdriver.common.by import By
import threading
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def main():
driver.get('http://zefoy.com')
sleep(10) #give time to solve captcha
print('switching')
opt.headless = True
opt.add_argument('--headless')
opt.add_argument('--disable-gpu')
#begin automation
if __name__ == "__main__":
opt = webdriver.ChromeOptions()
driver = uc.Chrome(use_subprocess=True, options=opt)
wait = WebDriverWait(driver, 15)
driver.set_window_size(1024, 480)
driver.delete_all_cookies()
main()
But it doesn't work and the interface stays Thanks