Trying to read comments from Likedin feed by:
comments = browesr.find_elements_by_xpath("//*[@class='comments-comments-list__comment-item comments-comment-item ember-view']")
print(comments[0].id)
print(comments[1].id)
print(comments[2].id)
print(comments[0].get_attribute("id"))
print(comments[1].get_attribute("id"))
print(comments[2].get_attribute("id"))
print(comments[0].find_element_by_xpath("//*[@data-control-name='comment_actor_description']").text)
print(comments[1].find_element_by_xpath("//*[@data-control-name='comment_actor_description']").text)
print(comments[2].find_element_by_xpath("//*[@data-control-name='comment_actor_description']").text)
Output:
0.854587949237863-1
0.854587949237863-2
0.854587949237863-3
ember817
ember851
ember885
Ralph M.
out of network
3rd+
Managing Director at Intervi
Ralph M.
out of network
3rd+
Managing Director at Intervi
Ralph M.
out of network
3rd+
Managing Director at Intervi
As you can see the IDs are diffrent but the elements inside each one is the same one (the first one), what could be the issue?