Works fine for me.
I would recommend that you review how arrays and string processing work. It will save you a lot of time.
Is it safe to assume you don't know how arrays and indexing works? Because the solution (without error checking and a function built into one specific label), is just:
Split returns an array of strings that are divided by the token you give.
return get_text().split("\n")[num - 1]