Python webelement列表在框架切换时变为空

Python webelement列表在框架切换时变为空,python,selenium-webdriver,Python,Selenium Webdriver,使用Python和seleniumwebdiver,我从一个HTML页面生成报告 #report name starts with 'std' folderSize = len(driver.find_elements_by_xpath("//*[contains(@id,'std')]")) reportList = driver.find_elements_by_xpath("//*[contains(@id,'std')]") innerIterator = 0 while ( inne

使用
Python
seleniumwebdiver
,我从一个HTML页面生成报告

#report name starts with 'std'
folderSize = len(driver.find_elements_by_xpath("//*[contains(@id,'std')]"))
reportList = driver.find_elements_by_xpath("//*[contains(@id,'std')]")

innerIterator = 0
while ( innerIterator < folderSize) :

    reportList = driver.find_elements_by_xpath("//*[contains(@id,'std')]")
    reportName = reportList[innerIterator].text

    ##### generate report    
    driver.find_element_by_partial_link_text(reportName).click()
    driver.implicitly_wait(3)    

    driver.switch_to_default_content()
    driver.implicitly_wait(3) 
    reportList = driver.find_elements_by_xpath("//*[contains(@id,'std')]")

    ##### reportList Becomes NULL here when invoked second time. First Report is successfully generated.
    ##### Unable to get seocnnd element in the list

    print("Generate report")

    innerIterator = innerIterator + 1
#报告名称以“std”开头
folderSize=len(驱动程序。通过xpath(“/*[contains(@id,'std')]”)查找元素)
reportList=driver.通过xpath(“/*[contains(@id,'std')]”)查找元素
innerIterator=0
while(innerIterator
reportList
在调用
switch\u to\u default\u content()
并随后调用
driver之后变为
NULL
。通过xpath(“/*[contains(@id,'std')]”)查找元素
返回
NULL