p = subprocess.Popen([
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
f"--remote-debugging-port={SOME_PORT_NUM}",
"--no-first-run",
"--no-default-browser-check",
"--disable-popup-blocking",
"--start-maximised",
"--user-data-dir=/tmp/chrome-profile"
])
p.wait()
print("exited")
My expectation would be that p.wait() would block until I closed the browser - instead what I see on the terminal is:
Opening in existing browser session.
exited
Is there a way of getting this to match my expectations?
Would not p.communicate() help in this case?
stdout, stderr = p.communicate()
this way the python could actually request the return message and wait for the process to finish.
EDIT:
As we have kind of agreed on this with Jean-Francois Fabre, I believe that the issue may be with multiprocessing which Chrome uses. The process you call for may have finished its job as chrome calls for another process completing the load. (Just raw idea)