How can I print the value of the href attribute?
<a href="aaaaa.pdf"></a>
How can I print the link aaaaa.pdf with python selenium?
HTML:
<div class="xxxx">
<a href="aaaaa.pdf"></a>
</div>
You can do like this:
print(driver.find_element_by_css_selector(".xxxx a").get_attribute('href'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With