I suppose the HTML file is something like the one below:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<code id="user-code">SRQX-FJXQ</code>
</body>
</html>
And you want to get SRQX-FJXQ
. Here is the Robot code:
*** Test Cases ***
Get Code
Open Browser ${path_to_your_html} chrome
${code}= Get Text xpath=//*[@id="user-code"]
Log To Console User code value: ${code}
Close Browser
Here is the result: