Hi I am trying access an element in selenium that looks like this when I inspect element:
<div class="im_message_outer_wrap hasselect" ng-click="toggleMessage(historyMessage.mid, $event)" data-msg-id="5973">
I have tried to find element using its xpath as follows:
element = driver.find_element_by_xpath("//div[@class = 'im_message_outer_wrap hasselect'][@data-msg-id='5967']")
This keeps returning an error saying unable to locate element. What am i doing wrong or is there a better way to access this element. The data-msg-ID is important because in the code I want to be able to iterate through ids to grab each element in order.