Chrome opens with “Data;” with selenium chromedriver

后端 未结 2 957
日久生厌
日久生厌 2020-12-18 00:55

Trying to open "Google" or any other page (website) from Chrome via selenium chrome driver in python.

The code is :

from selenium import webd         


        
相关标签:
2条回答
  • 2020-12-18 01:27
    import time
    
    time.sleep(1)
    driver.switch_to.window(driver.window_handles[1])
    driver.close()
    driver.switch_to.window(driver.window_handles[0])
    time.sleep(1)
    
    0 讨论(0)
  • 2020-12-18 01:40

    You don't need as much module for this just remove all of those apart from: from selenium import webdriver

    And try again you will not get another tab with congaing data.

    0 讨论(0)
提交回复
热议问题