Native JS document.createElement("html") is not working in Sandbox

@ttftt Just saw this post and wanted to still answer it.
You and the fellow future readers of this question might want to go through @deepak.pathania’s answer here - Getting HTML response - want to parse certain fields to next request