<span class="class">more text</span>
[text, more text]
exceptions.AttributeError: 'list' object has no attribute 'text'
find_element_by_xpath returns one element, which has
find_elements_by_xpath() returns all matching elements, which is a list, so you need to loop through and get
text attribute for each of the element.
all_spans = driver.find_elements_by_xpath("//span[@class='class']") for span in all_spans: print span.text
Please refer to Selenium Python API docs here for more details about