其中用 < > 括號的可以換掉
docker run -d -p <4444>:4444 --name <p4444> --add-host=host.docker.internal:host-gateway --shm-size="2g" selenium/standalone-chrome:103.0'
driver = webdriver.Remote(
command_executor='http://127.0.0.1:<4444>/wd/hub',
options=options)
os.system('docker container stop p4444')
time.sleep(1)
os.system('docker container rm p4444')
time.sleep(1)
os.system('docker run -d -p '+str(portnum)+':4444 --name p4444 --add-host=host.docker.internal:host-gateway --shm-size="2g" selenium/standalone-chrome:103.0')
time.sleep(18)