I'm using selenium and Python and I am trying to execute a JS function that takes in a string like so:
browser.execute_script("foo('someString')")
This works when someString does not have any newlines. When there is a newline character the following happens:
\n => Parse Error
\\n => Newline is converted to a space
\r\n => Parse Error
\\r\\n => Both characters are converted to a space
Is there a way to do this?