-1

Currently my code is the following:

const fetch = require("node-fetch");

(async function () {
  console.log(await fetch("https://a.website.in-ht.ml"));
})()

However, It is only returning data on the website, as opposed to the HTML. Anyone know what the issue may be?

(As the title says, I am using v2.6 not 3.0+)

1 Answers1

0

Try this:

const fetch = require("node-fetch");

(async function () {
  const res = await fetch("https://a.website.in-ht.ml")
  const html = await res.text()
  console.log(html)
})()

This takes the text response instead of the full response.

ztcollazo
  • 159
  • 1
  • 8