1
2
3
4
5
6
7
8
9
10
11
import { fetch } from "https://esm.town/v/std/fetch";
export async function fetchHtmlDom(url: string) {
const { DOMParser } = await import(
"https://deno.land/x/deno_dom/deno-dom-wasm.ts"
);
const response = await fetch(url);
const html = await response.text();
const parser = new DOMParser();
return parser.parseFromString(html, "text/html");
}