You don't get HTML. Neither do I. A couple years back there was a well-received "semantic HTML" submission here. I was in the small minority wondering how come `<div class="button">` is better semantics than `<button>`.
I've come to think the error in semantic HTML is that humans think there's a difference between "button" and "ceqnej"... but there isn't. Something has to actually define the difference. Computers don't care.
Where can I get this definition and apply it to my program?
There isn't one.
The browser knows what a <button> is, but it knows a lot of other things. <button> isn't particularly special.
I still have to explain it to any program I may write, and it's no skin off my nose to explain it what a "button" is, or a <div class="button">, or a <div class="ceqnej">. If I don't speak English that's what button looks like anyhow.
What I can get for my program is a specification of HTML and a compliant parser. But that provides extremely weak "semantics".
"Semantic HTML" is a cognitive illusion brought about by looking at 62 75 74 74 6F 6E and conflating your human read of those bytes with real meaning.
(There is value to using nice-looking HTML... but the value is for humans, and has more to do with principles of software engineering and data organization and virtually nothing to do with "semantics".)