selectolax: how to get text of an element?
10:24 07 Dec 2025

I have

from selectolax.lexbor import LexborHTMLParser

html = """

    *
    rannijaną

"""

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 ... , i.e., rannijaną.

Could you explain how to do so?

python web-scraping