Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
izidorio committed Dec 22, 2021
1 parent 270b0bf commit a32b7cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/js/models/scraping.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -86,7 +89,7 @@ export async function readGroup() {
}

resolve(contacts);
//setHeight('100%');
setHeight('100%', '.nBIOd.tm2tP');

}, 1500);

Expand All @@ -108,4 +111,4 @@ export function readListParticipants(){
}


// _2nY6U
4 changes: 2 additions & 2 deletions src/js/models/utils.js
Original file line number Diff line number Diff line change
@@ -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) {

Expand Down

0 comments on commit a32b7cc

Please sign in to comment.