1
2
3
4
5
6
7
8
9
10
import { fetch } from "https://esm.town/v/std/fetch";
export const scrapValue = async (url, selector, attr) => {
const { DOMParser } = await import(
"https://deno.land/x/deno_dom/deno-dom-wasm.ts"
);
let doc = await (await fetch(url)).text();
const document = new DOMParser().parseFromString(doc, "text/html");
return document.querySelector(selector).getAttribute(attr);
};