[Python] how to send long text with send_keys using selenium python

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

  1. Stack

    Stack Membro Participativo

    I want to send a text that contains more than 4000 characters, and when I do that the browser

    crushs and keep opening new tabs (idk why), but when I try to send only 600 characters it works fine.

    browser.get('website')
    search = browser.find_element_by_id("text-area")
    search.clear()
    #browser.execute_script('arguments[0].value=arguments[1]', search, data)
    search.send_keys(data[0:600])
    browser.find_element_by_id("btn").click()


    "data" is the variable containing the text (all good with it)

    I tried the script in comment and it does send all of the text, but when the browser click on the button .

    it reads the old text (default one)

    Any help would be appreciated, thanks for your time!!

    Continue reading...

Compartilhe esta Página