1 回答

TA贡献1744条经验 获得超4个赞
这是其中之一的示例。
#,[@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>
……等等。如果您只想要文本,请使用 elem.text。
进口
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
添加回答
举报