Triggering a python script that opens a browser window

I'd like to use the exec node to run a script that will open a browser window to download a file. The script runs fine when run from the command line but nothing happens when I run it using the exec node, there's no error or anything with the debug node.
I'm running nodered on a raspberry pi4, and the code that opens it is webbrowser.open_new(downloadurl)
I appreciate any help, please let me know if more info would be helpful

Have you checked for error output?

Most likely, the Node-RED runtime environment does not have a ui. So the browser cannot start.

That was it, thank you very much.

Solution: Include the following in the script

from pyvirtualdisplay import Display
display = Display(visible=0, size=(800, 600))
display.start()

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.