1 回答

TA貢獻1875條經(jīng)驗 獲得超3個贊
在 devtools 中,如果你從你的元素向上滾動,你可以看到你的輸出文本區(qū)域嵌套在:
<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)
添加回答
舉報