Skip to content

Text Formatting #3824

Closed
Closed
@zoennnnn

Description

@zoennnnn

Hi bros,

I've been developing programs using SeleniumBase, and it works really well against websites with strong bot detectors. However, I have a minor issue related to text formatting. I've been trying to use only the native functions of CDP mode for a site I am working on, and whenever I try to input long text into an input field, the line breaks('\n') and or spacing are stripped out.

I also tried using pyperclip, but didn't worked well with cdp mode.

Example Result:

Image

from seleniumbase import SB
import pdb

with SB(uc=True) as bot:

    text = """
    ✅ SeleniumBase README
    🏰 List of Features
    📚 Running Example Tests
    🎛️ Command Line Options
    ✅ SeleniumBase README
    🏰 List of Features
    📚 Running Example Tests
    Hello\nWorld
    """
    pdb.set_trace()
    bot.activate_cdp_mode('https://google.com')
    bot.set_text('[aria-label="Search"]', text)

Metadata

Metadata

Assignees

No one assigned

    Labels

    UC Mode / CDP ModeUndetected Chromedriver Mode / CDP ModequestionSomeone is looking for answers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions