This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DOMParser } from 'https://deno.land/x/deno_dom/deno-dom-wasm.ts'; | |
const url = 'http://books.toscrape.com/'; | |
try { | |
const res = await fetch(url); | |
const html = await res.text(); | |
const doc: any = new DOMParser().parseFromString(html, 'text/html'); | |
const books: any = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DOMParser } from 'https://deno.land/x/deno_dom/deno-dom-wasm.ts'; | |
const url = 'http://books.toscrape.com/'; | |
try { | |
const res = await fetch(url); | |
const html = await res.text(); | |
const doc: any = new DOMParser().parseFromString(html, 'text/html'); | |
const pageHeader = doc.querySelector('.header').querySelector('.h1').textContent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const url = 'http://books.toscrape.com/'; | |
try { | |
const res = await fetch(url); | |
const html = await res.text(); | |
console.log(html) | |
} catch(error) { | |
console.log(error); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const url = 'http://books.toscrape.com/'; | |
try { | |
console.log(url) | |
} catch(error) { | |
console.log(error); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const url = 'http://books.toscrape.com/'; | |
try { | |
console.log(url) | |
} catch(error) { | |
console.log(error); | |
} |