try:
handles = drv.window_handles
if handles:
drv.switch_to.window(handles[0])
#assume one window
#simple way to implement into your code if its a small service exception can be handled if the url of the window cant be read note:check if your server is running