2

I have been using the Naked.toolshed.shell library of python to launch a js script with a gived argument. The problemm is that when "&" is in the argument js only obtains what goes before that symbol, for example Python:

from Naked.toolshed.shell import execute_js, muterun_js
link ="example_of_a_link.com/width=640&crop....."
response = execute_js('/file.js', link)

Js:

var pi = process.argv[2];
console.log(pi);    

And what CMD shows:

example_of_a_link.com/width=640

So & and what goes after is missed, how can I fix it?

Kodos23
  • 65
  • 8

1 Answers1

0

You can escape the & with ^ by passing...

link.replace('&', '^&')

...to execute_js()

davmos
  • 9,324
  • 4
  • 40
  • 43