ajotu du scraping de bibliothèque
Signed-off-by: tykayn <contact@cipherbliss.com>
This commit is contained in:
parent
265f50291d
commit
4f828962c1
|
@ -22,7 +22,7 @@ const books: Book[] = [];
|
||||||
// autres pages:
|
// 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
|
// 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
|
let page_max = 1927
|
||||||
page_max = 4
|
// page_max = 4
|
||||||
|
|
||||||
const getTables = (html: string): any => {
|
const getTables = (html: string): any => {
|
||||||
const $ = cheerio.load(html);
|
const $ = cheerio.load(html);
|
||||||
|
@ -93,10 +93,10 @@ const scrapOnePage = (tables: any) => {
|
||||||
let img_src = $(table).find('td img').attr('src');
|
let img_src = $(table).find('td img').attr('src');
|
||||||
console.log(img_src);
|
console.log(img_src);
|
||||||
books.push({
|
books.push({
|
||||||
author: boom[0].trim(),
|
author: boom[0],
|
||||||
title: splitting[0].trim(),
|
title: splitting[0],
|
||||||
description: splitting[1].trim(),
|
description: splitting[1],
|
||||||
format: format[1].trim(),
|
format: format[1],
|
||||||
img: img_src
|
img: img_src
|
||||||
})
|
})
|
||||||
// console.log(cheerio.load(table).html())
|
// console.log(cheerio.load(table).html())
|
||||||
|
|
113864
scraping/output/books.json
113864
scraping/output/books.json
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue