i have a script for automation which is not working because of captcha after going to URL. i want you should integrate gradio by which I will solve the captcha manually. here is my full script, remember don't change web driver setup portion # Install Required Libraries
import sys
if 'google.colab' in sys.modules:
    get_ipython().system('pip install selenium webdriver-manager validators ipywidgets')
    get_ipython().system('apt-get update')
    get_ipython().system('apt-get install -y chromium chromium-driver')
    get_ipython().system('jupyter nbextension enable --py widgetsnbextension --sys-prefix')

# Import Necessary Libraries
import os
import ipywidgets as widgets
from IPython.display import display, clear_output
from ipywidgets import Layout, VBox, HBox
from google.colab import drive
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException, NoSuchElementException
import validators  # For URL validation

# Mount Google Drive to Access Files
drive.mount('/content/drive')

# Function to Set Up Selenium WebDriver
def setup_webdriver():
    options = webdriver.ChromeOptions()
    options.add_argument("--verbose")
    options.add_argument("--no-sandbox")
    options.add_argument("--headless")
    options.add_argument("--disable-gpu")
    options.add_argument("--window-size=1920,1200")
    options.add_argument("--disable-dev-shm-usage")
    driver = webdriver.Chrome(options=options)
    return driver

# Initialize WebDriver Variable
driver = None

# Create UI Components

# Widget to Select Zip File from Google Drive
input_zip_widget = widgets.Select(
    options=[],
    description='Input Zip File:',
    disabled=False,
    layout=Layout(width='100%', height='200px')
)

# Button to Refresh the List of Zip Files
refresh_button = widgets.Button(
    description='Refresh Zip Files List',
    disabled=False,
    button_style='info',
    tooltip='Click to refresh the list of zip files',
    icon='refresh'
)

# Text Widget for Username (Empty by Default for Security)
username_widget = widgets.Text(
    value='',  # Empty by default
    placeholder='Enter your username',
    description='Username:',
    disabled=False,
    layout=Layout(width='auto')
)

# Password Widget for Password (Empty by Default for Security)
password_widget = widgets.Password(
    value='',  # Empty by default
    placeholder='Enter your password',
    description='Password:',
    disabled=False,
    layout=Layout(width='auto')
)

# Text Widget for File Path (Optional)
file_path_widget = widgets.Text(
    value='',
    placeholder='Enter the path to your zip file in Colab',
    description='File Path:',
    disabled=False,
    layout=Layout(width='auto')
)

# Text Widget for Output Directory with Default Path
output_dir_widget = widgets.Text(
    value='/content/drive/MyDrive/UploadLinks',
    placeholder='Enter output directory path',
    description='Output Dir:',
    disabled=False,
    layout=Layout(width='auto')
)

# Button to Start the Upload Process
start_upload_button = widgets.Button(
    description='Start Upload',
    disabled=False,
    button_style='success',
    tooltip='Click to start uploading the selected zip file',
    icon='upload'
)

# Output Widget to Display Logs and Messages
output = widgets.Output()

# Helper Function to Find Elements with Multiple Selector Strategies
def find_element(driver, selectors, timeout=10):
    """
    Attempts to locate a web element using a list of selector strategies.
    
    Args:
        driver (webdriver.Chrome): Selenium WebDriver instance.
        selectors (list): List of tuples containing (By, selector).
        timeout (int): Maximum time to wait for the element.
    
    Returns:
        element (WebElement): Located web element.
    
    Raises:
        NoSuchElementException: If the element is not found using any of the selectors.
    """
    for selector in selectors:
        try:
            element = WebDriverWait(driver, timeout).until(
                EC.presence_of_element_located(selector)
            )
            return element
        except TimeoutException:
            continue
    raise NoSuchElementException(f"Element not found using selectors: {selectors}")

# Function to Update the List of Zip Files from Google Drive
def update_zip_files(b):
    """
    Refreshes the list of zip files available in the specified Google Drive directory.
    
    Args:
        b: Button click event (unused).
    """
    with output:
        clear_output()
        print("Refreshing the list of zip files...")
        drive_root = '/content/drive/MyDrive/'  # Modify this path as needed
        zip_files = []
        for root, dirs, files in os.walk(drive_root):
            for file in files:
                if file.lower().endswith('.zip'):
                    full_path = os.path.join(root, file)
                    zip_files.append(full_path)
        if zip_files:
            input_zip_widget.options = zip_files
            print(f"Found {len(zip_files)} zip file(s) in {drive_root}.")
        else:
            input_zip_widget.options = []
            print(f"No zip files found in {drive_root}.")

# Function to Start the Upload Process
def start_upload(b):
    """
    Automates the process of uploading a zip file to dupload.net.
    
    Args:
        b: Button click event (unused).
    """
    global driver
    with output:
        clear_output()
        # Retrieve User Inputs
        selected_zip = input_zip_widget.value
        username = username_widget.value.strip()
        password = password_widget.value.strip()
        file_path = file_path_widget.value.strip()
        output_dir = output_dir_widget.value.strip()
        
        # Input Validation
        if not selected_zip and not file_path:
            print("No zip file selected and no file path provided. Please select a zip file or enter a valid file path.")
            return
        if not username or not password:
            print("Username and password cannot be empty.")
            return
        if not output_dir:
            print("Output directory path cannot be empty.")
            return
        
        # Determine the Zip File Path
        if selected_zip:
            zip_path = selected_zip
        else:
            zip_path = file_path
            if not os.path.isfile(zip_path):
                print(f"The file at {zip_path} does not exist.")
                return
        
        # Ensure the Output Directory Exists
        if not os.path.exists(output_dir):
            try:
                os.makedirs(output_dir)
                print(f"Created output directory at {output_dir}.")
            except Exception as e:
                print(f"Failed to create output directory at {output_dir}: {e}")
                return
        
        # Setup WebDriver
        print("Setting up the WebDriver...")
        try:
            driver = setup_webdriver()
            print("WebDriver setup completed.")
        except Exception as e:
            print(f"Failed to initialize WebDriver: {e}")
            return
        
        try:
            # Navigate to the Login Page
            print("Navigating to the login page...")
            driver.get("https://dupload.net/login.html")
            
            # Enter Username
            try:
                username_selectors = [
                    (By.NAME, "login"),
                    (By.XPATH, "//input[@placeholder='Username']"),
                    (By.CSS_SELECTOR, "input.form-control")
                ]
                username_field = find_element(driver, username_selectors)
                username_field.clear()
                username_field.send_keys(username)
                print("Entered username.")
            except NoSuchElementException as e:
                print(f"Username input field not found: {e}")
                return
            
            # Enter Password
            try:
                password_selectors = [
                    (By.NAME, "password"),
                    (By.XPATH, "//input[@placeholder='Password']"),
                    (By.CSS_SELECTOR, "input[type='password']")
                ]
                password_field = find_element(driver, password_selectors)
                password_field.clear()
                password_field.send_keys(password)
                print("Entered password.")
            except NoSuchElementException as e:
                print(f"Password input field not found: {e}")
                return
            
            # Click "Log In" Button
            try:
                login_button_selectors = [
                    (By.CSS_SELECTOR, "button.btn.btn-primary[type='submit']"),
                    (By.XPATH, "//button[contains(text(), 'Log in')]"),
                    (By.XPATH, "//button[@type='submit' and @value='Submit']")
                ]
                login_button = find_element(driver, login_button_selectors)
                login_button.click()
                print("Clicked 'Log in' button.")
            except NoSuchElementException as e:
                print(f"'Log in' button not found: {e}")
                return
            
            # Click "Upload Files" Link
            try:
                upload_files_selectors = [
                    (By.CSS_SELECTOR, "a[href='https://dupload.net/?op=upload_form']"),
                    (By.XPATH, "//a[contains(text(), 'Upload Files')]"),
                    (By.XPATH, "//a[@href='https://dupload.net/?op=upload_form']")
                ]
                upload_files_link = find_element(driver, upload_files_selectors)
                upload_files_link.click()
                print("Clicked 'Upload Files' link.")
            except NoSuchElementException as e:
                print(f"'Upload Files' link not found: {e}")
                return
            
            # Choose File
            try:
                file_input_selectors = [
                    (By.ID, "file_0"),
                    (By.XPATH, "//input[@type='file' and @id='file_0']"),
                    (By.CSS_SELECTOR, "input.uploadbtn.hidden")
                ]
                choose_file_input = find_element(driver, file_input_selectors)
                choose_file_input.send_keys(zip_path)
                print(f"Selected file: {zip_path}")
            except NoSuchElementException as e:
                print(f"'Choose File' input not found: {e}")
                return
            
            # Click 'Start Upload' Button
            try:
                start_upload_selectors = [
                    (By.XPATH, "//button[contains(text(),'Start Upload') or @id='start-upload']"),
                    (By.CSS_SELECTOR, "button.upload-start")
                ]
                start_upload_button_element = find_element(driver, start_upload_selectors)
                start_upload_button_element.click()
                print("Clicked 'Start Upload' button. Upload initiated...")
            except NoSuchElementException as e:
                print(f"'Start Upload' button not found: {e}")
                return
            
            # Click "Start Uploading" Button
            try:
                start_uploading_selectors = [
                    (By.CSS_SELECTOR, "button[name='upload']"),
                    (By.XPATH, "//button[contains(text(), 'Start uploading')]"),
                    (By.XPATH, "//button[@type='button' and @name='upload']"),
                    (By.XPATH, "//button[contains(@class, 'btn-white') and @name='upload']")
                ]
                start_uploading_button = find_element(driver, start_uploading_selectors)
                start_uploading_button.click()
                print("Clicked 'Start uploading' button.")
            except NoSuchElementException as e:
                print(f"'Start uploading' button not found: {e}")
                return
            
            # Wait for Upload to Complete and Retrieve Download Link
            print("Waiting for the upload to complete...")
            download_link = None
            try:
                download_link_selectors = [
                    (By.CSS_SELECTOR, "input.download-link"),
                    (By.XPATH, "//input[@id='download-link']")
                ]
                download_link_element = WebDriverWait(driver, 300).until(
                    EC.presence_of_element_located(download_link_selectors[0])
                )
                download_link = download_link_element.get_attribute("value")
                print("Upload completed. Retrieved the download link from input element.")
                
                try:
                    download_a_selectors = [
                        (By.CSS_SELECTOR, "a.download[href^='https://dupload.net/']"),
                        (By.XPATH, "//a[contains(@href, 'dupload.net/') and contains(text(), 'Download')]"),
                        (By.CSS_SELECTOR, "a[href*='dupload.net/'][class='download']")
                    ]
                    download_a_element = WebDriverWait(driver, 60).until(
                        EC.presence_of_element_located(download_a_selectors[0])
                    )
                    download_a_href = download_a_element.get_attribute("href")
                    
                    if download_a_href.startswith("https://dupload.net/"):
                        download_link = download_a_href
                except TimeoutException:
                    pass
                except NoSuchElementException:
                    pass
                
            except TimeoutException:
                print("Timed out waiting for the download link.")
                return
            except NoSuchElementException as e:
                print(f"Download link element not found: {e}")
                return
            
            # Verify Download Link Exists and Save It
            if download_link:
                if validators.url(download_link) and download_link.startswith("https://dupload.net/"):
                    zip_file_name = os.path.basename(zip_path)
                    link_file_name = f"{os.path.splitext(zip_file_name)[0]}_upload_link.txt"
                    link_file_path = os.path.join(output_dir, link_file_name)
                    try:
                        with open(link_file_path, "w") as f:
                            f.write(download_link)
                        print(f"Upload link saved to {link_file_path}")
                    except Exception as e:
                        print(f"Failed to save the upload link: {e}")
                else:
                    print("Retrieved download link is invalid.")
            else:
                print("No download link found to save.")
        
        finally:
            if driver:
                driver.quit()  # Ensure the driver is closed to free up resources

# Attach Functions to Buttons
refresh_button.on_click(update_zip_files)
start_upload_button.on_click(start_upload)

# Arrange Widgets in the UI
ui = VBox([
    widgets.HTML('<h2>dupload.net File Upload Automation Tool</h2>'),
    HBox([refresh_button]),
    widgets.Label('Select a Zip File to Upload:'),
    input_zip_widget,
    widgets.Label('Or Enter the File Path Below:'),
    file_path_widget,
    widgets.HTML('<h3>Credentials</h3>'),
    HBox([username_widget, password_widget]),
    widgets.Label('Directory to Save Upload Links:'),
    output_dir_widget,
    start_upload_button,
    widgets.HTML('<hr>'),
    output
])

# Display the User Interface
display(ui)

# Initial Population of Zip Files List
update_zip_files(None)