김빵디

AttributeError: 'list' object has no attribute 'get_attribute'. Did you mean: '__getattribute__'? 해결방법 본문

외로운 싸움/Selenium

AttributeError: 'list' object has no attribute 'get_attribute'. Did you mean: '__getattribute__'? 해결방법

김빵디 2022. 5. 20. 18:09
728x90

잘못되면 고치면되지!

elements → element로 사용하면 됨

 

ex.

img = driver.find_elements_by_css_selector('._image') (X)
img = driver.find_element_by_css_selector('._image') (O)

a = driver.find_element_by_css_selector('abcd')

b = img.get_attribute('src')

728x90