Strategy to get list items from a web page

I am trying to build a list from items in a web page.
What would be a god strategy in order to get list items from a tree like this in the image?

The items I want is inside the

<article  class="msg-list_item">

The list items have this structure:

Can you do something similar as in this example:

*** Settings ***
Library  RPA.Browser.Selenium
*** Tasks ***
Test Browser Table
    Open Available Browser  https://rpaframework.org/
    ${table}=  Get WebElements    //table//tr

    FOR  ${row}  IN  @{table}
        ${locator_list} =  Create List  ${row}  xpath:td[1]
        ${text}=  Get Text  ${locator_list}
        Log  ${text}
    END

Instead of looping through tr elements you would loop

//article[@class='msg-list__items']/article[@class='msg-list__item']

Then you can use locator chaining the get the data you need from each msg-list__items.

2 Likes