From a32b7ccfcea90739e21e90a3d41740175c4cf3d6 Mon Sep 17 00:00:00 2001 From: Izidorio Bento Date: Wed, 22 Dec 2021 08:40:37 -0300 Subject: [PATCH] fix --- src/js/models/scraping.js | 11 +++++++---- src/js/models/utils.js | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/js/models/scraping.js b/src/js/models/scraping.js index 209f70c..b632b67 100644 --- a/src/js/models/scraping.js +++ b/src/js/models/scraping.js @@ -28,19 +28,22 @@ export function dateCreatedGroup() { export async function readGroup() { - // await setHeight('9999999999px'); + await setHeight('9999999999px', '.nBIOd.tm2tP'); return new Promise( async ( resolve ) => { setTimeout( () => { // div que envolve o avatar e os dados dos participantes do grupo - let elements = document.querySelectorAll('._2nY6U._3A-iD'); + // let elements = document.querySelectorAll('._2nY6U._3A-iD'); + let elements = document.querySelectorAll('._2nY6U'); + console.log({elements}); let contacts = []; for (let item of elements){ // wrappers: avatar e conteúdo + console.log({item}); const [div_wrapper_avatar, div_wrapper_content] = item.childNodes; // wrapper image < flex < div_wrapper_avatar @@ -86,7 +89,7 @@ export async function readGroup() { } resolve(contacts); - //setHeight('100%'); + setHeight('100%', '.nBIOd.tm2tP'); }, 1500); @@ -108,4 +111,4 @@ export function readListParticipants(){ } - \ No newline at end of file +// _2nY6U \ No newline at end of file diff --git a/src/js/models/utils.js b/src/js/models/utils.js index 89469e0..2355253 100644 --- a/src/js/models/utils.js +++ b/src/js/models/utils.js @@ -1,8 +1,8 @@ -export function setHeight(size){ +export function setHeight(size, filter = '.ldL67._1bLj8'){ return new Promise( (resolve) => { //div aside direta - const containerHack = document.querySelector('.ldL67._1bLj8'); + const containerHack = document.querySelector(filter); if(containerHack) {