1 回答
TA貢獻(xiàn)1744條經(jīng)驗(yàn) 獲得超4個(gè)贊
這是其中之一的示例。
#,[@bgcolor='#C6C600'],[@bgcolor='#70B8B8']
elements=WebDriverWait(driver, 30).until(EC.visibility_of_all_elements_located((By.XPATH, "//tr[@bgcolor='#C184FF']")))
#print(len(elements))
for elem in elements:
print(elem.get_attribute('innerHTML'))
輸出
<td><input type="checkbox" name="id[]" value="49516">3F INDUSTRIES LIMITED <strong>[TH]</strong></td>
<td>TURMERIC</td>
……等等。如果您只想要文本,請(qǐng)使用 elem.text。
進(jìn)口
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
添加回答
舉報(bào)
