TypeError: ‘WebElement’ object is not iterable error

The problem is that you are using find_element_by_xpath which return only one WebElement (which is not iterable), the find_elements_by_xpath return a list of WebElements.

Solution: replace find_element_by_xpath with find_elements_by_xpath

Reference: selenium-python docs

Leave a Comment