1 回答

TA贡献1875条经验 获得超3个赞
在 devtools 中,如果你从你的元素向上滚动,你可以看到你的输出文本区域嵌套在:
<iframe name="result" id="result" style="height: 180px; width: 800px;" scrolling="no" frameborder="0">
这些需要在硒中进行额外处理。
在脚本末尾试试这个:
#Get the frame
WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH,"//iframe[@name='result']")))
#wait for your object to be ready - i use clickable as i like it
out = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH,"//textarea[@name='outputText']")))
print(out.text)
#do stuff your stuff to the "out" element here
#when ready to go back to the main page content (not the iframe)
driver.switch_to_default_content()
当我运行你的代码时,我得到了输出:
表:tetSelect CRD_TRADE_REP(1,40) 列:selectList CRD_TRADE_REP.M_NB(1,12)
添加回答
举报