I just want to print the HTML page, It seems that I always get
I think the problem is with the line // console.log(text);
Hers the code:
async function get_ted_html() {
try {
const response = await fetch('https://www.ted.com/', {
mode: "no-cors",
headers: {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0"
}});
const text = await response.text();
console.log(text);
} catch (error) {
console.error(error);
}
}
get_ted_html();
please, can someone hep me spot the problem.
New contributor
Shaun is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.