How do you close and then open the browser window again?



  • When attempting to start the next code

    drive = webdriver.Chrome(chromedriver_locator)
    drive.get(any_syte)
    drive.close()
    drive.get(any_syte)
    

    Receiving a WebDriverException: Message: no such session Is there any way to close and then open a new window within one web session?



  • Try after. closeCall the method. drive.start_session({})because when you call the method close The open session is adjourned.

    drive = webdriver.Chrome(chromedriver_locator)
    drive.get(any_syte)
    drive.close()
    drive.start_session({})
    drive.get(any_syte)
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2