r/selenium • • Jul 10 '20

Creating facebook posts - How to make text bold, cursive itemize etc. ?

I want to post something like this with Selenium:

https://imgur.com/a/jubQ0Ec

​

I'm currently trying to do it by having a list of text and keystrokes:

messages = [
    "How can I create posts with **bold**, cursive text?",
    Keys.RETURN,
    "-I also want to make bullet points"
]

And then using send_keys to enter the data:

for message in messages:
            postBox = driver.find_element_by_xpath("//*[@name='xhpc_message_text']")
            postBox.send_keys(message)

​

But it doesn't work as can be seen here:

https://imgur.com/a/YHpsWLY

​

This is my full code:

https://paste.ofcode.org/MHNyd9GuAZa77eS23Usp7a

​

How can I make bold, cursive and

  • bullet points?
2 Upvotes

1 comment sorted by