connections=driver.find_elements_by_css_selector("a span[class='mn-connection-card__name t-16 t-black t-bold']")
print(len(connections))
for connection in connections:
if connection.text == "XXX":
connection.click()
break
我在 if 语句中收到以下错误:
过时的元素引用:元素未附加到页面文档