[Python] TikTok Automated Upload bot wont publish Videos

Discussão em 'Python' iniciado por Stack, Abril 29, 2025.

  1. Stack

    Stack Membro Participativo

    ikTok Upload Bot Automation Failing at Final Step?

    I’m currently developing an automated upload bot for TikTok Studio (https://www.tiktok.com/tiktokstudio/upload) using Selenium, to upload multiple videos in a batch.

    The bot is already quite advanced and works in almost all aspects – however, it fails at the final step: clicking the “Post” button, even though it appears visually active (red) on the page.

    ⸻

    What Works So Far:
    • Automatic login using saved cookies (cookies.pkl)
    • Upload page is opened successfully, and the upload area is correctly detected
    • .mp4 files are uploaded one after another via
    • The loading bar disappears → TikTok visually indicates the video is ready to post

    ⸻

    The Problem:

    Once the upload is finished, the “Post” button becomes visible and looks active (red). But Selenium cannot click it. It throws an error like:
    ❌ Failed to click post button: ElementNotInteractableException
    ❌ Failed to click post button: ElementNotInteractableException

    Relevant Code :

    try:
    # Locate post button
    post_button = wait.until(EC.presence_of_element_located((By.XPATH, '//button[contains(text(),"Beitrag")]')))

    # Scroll into view
    driver.execute_script("arguments[0].scrollIntoView(true);", post_button)
    time.sleep(1)

    if post_button.is_enabled():
    try:
    post_button.click()
    print("✅ Clicked normally")
    except Exception:
    # Fallback via JS
    driver.execute_script("arguments[0].click();", post_button)
    print("✅ JS click successful")
    else:
    print("❌ Button found but not active!")
    except Exception as e:
    print("❌ Failed to click post button:", e)


    What I’ve Tried:
    • element_to_be_clickable
    • scrollIntoView() to ensure visibility
    • JavaScript fallback via driver.execute_script("arguments[0].click()", button)
    • Waiting for is_enabled(), is_displayed(), etc.

    The button stays present in the DOM and appears visually active, but seems blocked or not truly interactable by Selenium.

    ( Rest Info in other box )

    Continue reading...

Compartilhe esta Página