Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\switch_to.py", line 143, in _w3c_window
send_handle(window_name)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\switch_to.py", line 139, in send_handle
self._driver.execute(Command.SWITCH_TO_WINDOW, {'handle': h})
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 428, in execute
self.error_handler.check_response(response)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchWindowException: Message: Unable to locate window: page4
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.jsm:12:1
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:192:5
NoSuchWindowError@chrome://remote/content/shared/webdriver/Errors.jsm:446:5
GeckoDriver.prototype.switchToWindow@chrome://remote/content/marionette/driver.js:1226:11
despatch@chrome://remote/content/marionette/server.js:304:40
execute@chrome://remote/content/marionette/server.js:277:16
onPacket/<@chrome://remote/content/marionette/server.js:250:20
onPacket@chrome://remote/content/marionette/server.js:251:9
_onJSONObjectReady/<@chrome://remote/content/marionette/transport.js:502:20
permitUnload@chrome://global/content/elements/browser-custom-element.js:1681:21
CanCloseWindow@chrome://browser/content/browser.js:7980:36
WindowIsClosing@chrome://browser/content/browser.js:8009:7
BrowserTryToCloseWindow@chrome://browser/content/browser.js:3031:22
oncommand@chrome://browser/content/browser.xhtml:1:24
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\1 Python\work\projects\main.py", line 21, in <module>
driver.switch_to.window(f'page{num_page}')
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\switch_to.py", line 134, in window
self._w3c_window(window_name)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\switch_to.py", line 149, in _w3c_window
send_handle(handle)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\switch_to.py", line 139, in send_handle
self._driver.execute(Command.SWITCH_TO_WINDOW, {'handle': h})
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 428, in execute
self.error_handler.check_response(response)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchWindowException: Message: Unable to locate window: f24006de-3a5b-45ab-9e32-5a3eb239eca5
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.jsm:12:1
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:192:5
NoSuchWindowError@chrome://remote/content/shared/webdriver/Errors.jsm:446:5
GeckoDriver.prototype.switchToWindow@chrome://remote/content/marionette/driver.js:1226:11
despatch@chrome://remote/content/marionette/server.js:304:40
execute@chrome://remote/content/marionette/server.js:277:16
onPacket/<@chrome://remote/content/marionette/server.js:250:20
onPacket@chrome://remote/content/marionette/server.js:251:9
_onJSONObjectReady/<@chrome://remote/content/marionette/transport.js:502:20
observe@resource://gre/modules/AsyncShutdown.jsm:576:16
Process finished with exit code 1