Skip to content

Instantly share code, notes, and snippets.

View siddacool's full-sized avatar
🎯
Focusing

Siddhesh Mangela siddacool

🎯
Focusing
View GitHub Profile
@siddacool
siddacool / app.ts
Created November 4, 2020 14:40
deno-web-scraper: Bringing it all together
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 = [];
@siddacool
siddacool / app.ts
Created November 4, 2020 14:38
deno-web-scraper: Step 02
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;
@siddacool
siddacool / app.ts
Created November 4, 2020 14:36
deno-web-scraper: Step 02
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);
}
@siddacool
siddacool / app.ts
Created November 4, 2020 14:33
deno-web-scraper: Step 01
const url = 'http://books.toscrape.com/';
try {
console.log(url)
} catch(error) {
console.log(error);
}
@siddacool
siddacool / app.ts
Created November 3, 2020 14:33
step 01
const url = 'http://books.toscrape.com/';
try {
console.log(url)
} catch(error) {
console.log(error);
}