If you know that you will always have <a> , then just add it to XPath and then get text() from a .
If you really don't know if you always have a , then I would recommend using the .asText() method, which has all the HtmlElement and their descendants.
So, first get each of the spans:
List<?> topics = (List)page.getByXPath("//span[@class='topic']");
And then, in a loop, get the text inside each of the intervals:
topic.asText();
source share