Create Line Break in Whatsapp Message

How to create line break in WhatsApp message?

I have tried
PHP_EQL and its working.

i.e
echo "First Line".PHP_EQL."Second Line";

Output is

First Line

Second Line

How to line break in WhatsApp with Selenium when sending a message?

Solved this

def send_message(driver, answer):
driver.find_element_by_xpath('XPATH').click()
for line in answer.split('\n'):
ActionChains(driver).send_keys(line).perform()
ActionChains(driver).key_down(Keys.SHIFT).key_down(Keys.ENTER).key_up(Keys.SHIFT).key_up(Keys.ENTER).perform()
ActionChains(driver).send_keys(Keys.RETURN).perform()

Custom URL scheme to open text in whatsapp from mobile browser, newline / line break not working

Based on the URL scheme I'm pretty sure that %0A is the way to go, you could go as far as %0A%0D...

window.open("whatsapp://send?text=Hello%20World!%0AAnother%20Word")

Most languages will have a method for URL encoding - see this website for an example implementation:

http://meyerweb.com/eric/tools/dencoder/

How to make add break after paragraph in WhatsApp share on websites?

Try encoding your string. The character that you are probably looking for is LF line feed, which corresponds to %0A. Maybe something like this:

This%20is%20a%20sentence.%0AThis%20is%20another%20sentence.


Related Topics



Leave a reply



Submit