Hi Dan,
WebElements has a special TextNode element that is meant to be used to represent any text contained within elements. And as all DOM elements have no special handling but are direct translation of their HTML5 specifications you have to manually add the TextNode if you choose to use the DOM.A class directly:
from WebElements import DOM, Base
link = DOM.A(href="http://www.google.com/")
link += Base.TextNode(text="Go to Google!")
print link
Which outputs:
That said, what you probably want to do is use Buttons.Link (Which is a child class of DOM.A) instead. This will automatically add the text node if text is specified:
from WebElements.Buttons import Link
Which will result in the exact same HTML output.
I hope this make sense. You're welcome, thank you for asking the question :)
Timothy