我正在尝试使用特定名称迭代所有元素。 请按照下面的代码进行操作:
contacts = browser.find_element_by_css_selector('span.glyphicon.glyphicon-envelope')
a = 0
for contact in contacts:
a = a + 1
print('Total players found ', a)
但是我收到此错误消息:
for contact in contacts:
TypeError: 'WebElement' object is not iterable
请问如何创建可迭代列表?