Added periodic memory logger.
This commit is contained in:
@@ -66,7 +66,7 @@ function scrapeProfile({ query }) {
|
||||
const profile = {};
|
||||
|
||||
const keys = query.all('.model-descr_line:not(.model-descr_rait) p.text span', true);
|
||||
const values = query.all('.model-descr_line:not(.model-descr_rait) p.text').map(el => query.text(el));
|
||||
const values = query.all('.model-descr_line:not(.model-descr_rait) p.text').map((el) => query.text(el));
|
||||
const bio = keys.reduce((acc, key, index) => ({ ...acc, [slugify(key, '_')]: values[index] }), {});
|
||||
|
||||
if (bio.height) profile.height = Number(bio.height.match(/\((\d+)\s*cm\)/)?.[1]);
|
||||
@@ -100,7 +100,7 @@ function scrapeProfile({ query }) {
|
||||
profile.piercings = bio.piercings;
|
||||
}
|
||||
|
||||
if (bio.aliases) profile.aliases = bio.aliases.split(',').map(alias => alias.trim());
|
||||
if (bio.aliases) profile.aliases = bio.aliases.split(',').map((alias) => alias.trim());
|
||||
|
||||
const avatar = query.q('.model-img img');
|
||||
profile.avatar = avatar.getAttribute('src0_3x') || avatar.getAttribute('src0_2x') || avatar.dataset.src;
|
||||
|
||||
Reference in New Issue
Block a user