Added device image in GSMArena scraper + added child_process package

This commit is contained in:
lucmsilva651 2024-09-08 10:44:48 -03:00
parent 112cf3e960
commit dac6ebf032
No known key found for this signature in database
GPG key ID: D9B075FC6DC93985
3 changed files with 11 additions and 1 deletions

View file

@ -110,7 +110,9 @@ function formatPhone(phone) {
.map(([label, key]) => `<b>${label}:</b> <code>${formattedPhone[key]}</code>`)
.join("\n\n");
return `<b>${formattedPhone.name}</b>\n\n${attributes}`;
const deviceImage = phone.picture ? `<b>Device Image</b>: ${phone.picture}` : '';
return `<b>${formattedPhone.name}</b>\n\n${attributes}\n\n${deviceImage}`;
}
async function fetchHtml(url) {