ajotu du scraping de bibliothèque

Signed-off-by: tykayn <contact@cipherbliss.com>
This commit is contained in:
Tykayn 2023-08-18 10:18:14 +02:00 committed by tykayn
parent 265f50291d
commit 4f828962c1
2 changed files with 113869 additions and 5 deletions

View File

@ -22,7 +22,7 @@ const books: Book[] = [];
// autres pages:
// http://www.mediatheque-de-briis-sous-forges.net/mediatheque-de-briis-sous-forges.net/opac/recherche/catalogue?node=0&value=0&page=2
let page_max = 1927
page_max = 4
// page_max = 4
const getTables = (html: string): any => {
const $ = cheerio.load(html);
@ -93,10 +93,10 @@ const scrapOnePage = (tables: any) => {
let img_src = $(table).find('td img').attr('src');
console.log(img_src);
books.push({
author: boom[0].trim(),
title: splitting[0].trim(),
description: splitting[1].trim(),
format: format[1].trim(),
author: boom[0],
title: splitting[0],
description: splitting[1],
format: format[1],
img: img_src
})
// console.log(cheerio.load(table).html())

File diff suppressed because it is too large Load Diff