【发布时间】:2022-06-12 16:29:08
【问题描述】:
HTML:
<div class="xxxx">
<a href="ooooo.pdf"></a>
</div>
Python selenium 代码试验:
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
print(wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, "div.xxxx a"))).get_attribute('href'))
输出:
aaaaa.pdf
如何打印ooooo.pdf和aaaaa.pdf?
我想打印更多链接,我该怎么办?
【问题讨论】:
-
这能回答你的问题吗? Fetch all href link using selenium in python
-
谢谢。没有..
标签: python selenium selenium-webdriver webdriverwait getattribute