When I run the script with Python 3.10 on my local computer, it works correctly, but when I try to run it on the server using nohup, I get errors. The versions of the driver and the program are the same.
Errors:
When trying driver.window_handles (to find out how many windows), another error: selenium.common.exceptions.WebDriverException: Message: disconnected: not connected to DevTools (failed to check if window was closed: disconnected: not connected to DevTools) (Session info: chrome=110.0.5481.100). Maybe someone has encountered or knows what the problem is?
Code:
Errors:
Code:
NoSuchWindowException: Message: no such window: target window already closed from unknown error: web view not found (Session info: chrome=110.0.5481.100) or WebDriverException: Message: disconnected: Unable to receive message from renderer (failed to check if window was closed: disconnected: not connected to DevTools) (Session info: headless chrome=110.0.5481.100)
When trying driver.window_handles (to find out how many windows), another error: selenium.common.exceptions.WebDriverException: Message: disconnected: not connected to DevTools (failed to check if window was closed: disconnected: not connected to DevTools) (Session info: chrome=110.0.5481.100). Maybe someone has encountered or knows what the problem is?
Code:
Code:
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('disable-infobars')
options.add_argument("user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36")
loc = os.getcwd()
serv = Service("%s/chromedriver" % loc)
os.chmod("%s/chromedriver" % loc, 755) driver: webdriver.Chrome = webdriver.Chrome(options=options, service=serv) driver.get("any_link")