asked on
elems = driver.find_elements_by_xpath("//a[contains(@href,'abc.com')]")
#for elem in elems:
url = elems.get_attribute("href")
print(url)
I'm getting this error.AttributeError Traceback (most recent call last)
<ipython-input-291-f30319c0a4c2> in <module>
2 #for elem in elems:
3
----> 4 url = elems.get_attribute("href")
5 print(url)
AttributeError: 'list' object has no attribute 'get_attribute'
Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in other languages. Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive set of standard libraries, including NumPy, SciPy, Django, PyQuery, and PyLibrary.
TRUSTED BY