Option values when creating drivers
JavaScript
x
9
1
options = webdriver.ChromeOptions()
2
options.headless = True
3
options.add_argument('--no-sandbox')
4
options.add_argument("--disable-setuid-sandbox")
5
options.add_argument("--disable-setuid-sandbox")
6
options.add_argument('--disable-dev-shm-usage')
7
chrome_deriver_manager = ChromeDriverManager()
8
driver = webdriver.Chrome(chrome_deriver_manager.install(), options=options)
9
On the remote server(ubuntu on EC2) via ssh, Attempt to run Python scripts using selenium via nohup python3 ~~. py> ~/log.out &
It works well when maintaining the ssh connection with the server. But an error occurs a few seconds after disconnecting the ssh
selenium.common.exceptions.WebDriverException: Message: chrome not reachable (Session info: headless chrome=102.0.5005.61)
How do I complete the script even after I close the ssh connection?
I’ve already tried to terminate Chrome and Web Driver processes before executing the script
brower and web driver version info
JavaScript
1
6
1
> google-chrome --version
2
Google Chrome 102.0.5005.61
3
4
> chromedriver --version
5
ChromeDriver 102.0.5005.61 (0e59bcc00cc4985ce39ad31c150065f159d95ad3-refs/branch-heads/5005@{#819})
6
Advertisement
Answer
Try running screen
, hitting enter and then entering the nohup-command