Initial commit - cleaned for CV

This commit is contained in:
Renato97
2026-03-31 01:28:25 -03:00
commit 2e7bb89d77
6413 changed files with 1069318 additions and 0 deletions

49
backend/test-scraper.js Normal file
View File

@@ -0,0 +1,49 @@
import axios from 'axios';
import * as cheerio from 'cheerio';
async function testScraper() {
const url = 'https://manhwaweb.com/manga/one-piece_1695365223767';
try {
const response = await axios.get(url, {
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
}
});
const $ = cheerio.load(response.data);
console.log('=== Título de la página ===');
console.log($('title').text());
console.log('\n');
console.log('=== Buscando enlaces con /leer/ ===');
const leerLinks = [];
$('a').each((i, el) => {
const href = $(el).attr('href');
if (href && href.includes('/leer/')) {
leerLinks.push({
href: href,
text: $(el).text().trim()
});
}
});
console.log(`Encontrados ${leerLinks.length} enlaces:`);
leerLinks.slice(0, 10).forEach(link => {
console.log(` - ${link.href}: "${link.text}"`);
});
console.log('\n=== HTML sample around "Capitulo" ===');
const html = response.data;
const capIndex = html.indexOf('Capitulo 1');
if (capIndex > 0) {
console.log(html.substring(capIndex - 200, capIndex + 400));
}
} catch (error) {
console.error('Error:', error.message);
}
}
testScraper();