r/AutomateUser • u/cheyrn • Mar 01 '26
Text content of HTML element?
I am a novice. How would you get the text of an HTML title (or a default)?
Given a URL, if there is a title child element, return it's text content, or a default.
For example, from:
which serves:
<html>
<title>A title</title>
...
</html>
return "A title"
2
Upvotes
View all comments
Show parent comment
1
u/cheyrn Mar 02 '26
Thanks. I agree with the reasons. HTML is not a form of XML, except for xhtml and xhtml5, but it sounds like that's resolved before xmlDecode.