簡體   English   中英

Python Selenium find_elements 沒有給我當前元素

[英]Python Selenium find_elements not giving me the current element

我在 Python 中使用 Selenium 並循環以不斷檢查row元素的第一個孩子,因為它不斷變化,但是由於某種原因,當row的第一個孩子發生變化時, ele變量仍然保持不變,有什么解決方案嗎?

row = driver.find_elements(By.CLASS_NAME, 'row')[3]
while looprunning:
    ele= row.find_element(By.XPATH,"./child::*")

您還必須刷新該row

while looprunning:
    row = driver.find_elements(By.CLASS_NAME, 'row')[3]
    ele = row.find_element(By.XPATH,"./child::*")

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM