【发布时间】:2017-05-17 15:52:26
【问题描述】:
Picture: there is Popup window in the html
try:
all_handles = self.driver.window_handles
for handle in all_handles:
if handle != now_handle:
print handle
try:
self.driver.switch_to_window(handle)
self.driver.find_element_by_xpath(".//*[@id='ks-overlay-close-ks-component9045']").click()
except:
continue
但它失败了,我无法切换到窗口并关闭它
【问题讨论】:
标签: python selenium-firefoxdriver