How to get the value of an attribute in xpath

as shown in the following figure, can I use xpath to get the SCR value of the attribute? (or do you want to get the node first and then come out in another way?)

//div[@id="indexCarousel"]//div[@class="item"]//img[@src]
Apr.28,2021

//div[@id="indexCarousel"]//div[@class="item"]//img/@src
Menu