selectolax: how to get text of an element?

1 week ago 2
ARTICLE AD BOX

I have

from selectolax.lexbor import LexborHTMLParser html = """ <a rel="mw:WikiLink" href="Reconstruction" title="Proto-Germanic"> <span typeof="mw:Entity">*</span> rannijaną </a> """ tree = LexborHTMLParser(html) for d in tree.css('[rel="mw:WikiLink"]'): if d.text() is not None: print(d.text())

The result is

* rannijaną

I would like to take only the text of <a rel="mw:WikiLink" href="Reconstruction" title="Proto-Germanic"> ... </a>, i.e., rannijaną.

Could you explain how to do so?

Read Entire Article