How to get the full HTML of a website using the fetch() method in JavaScript?
Originally posted here!
/* Get full HTML from website using fetch() */
fetch(url)
.then((res) => res.text())
.then((html) => console.log(html));
Let's say we want to get the full HTML document of website https://google.com.
// URL
const url = "...
melvingeorge-me.hashnode.dev3 min read