whatsapp-web.js
whatsapp-web.js copied to clipboard
Please add feature to check users online status and last seen
Is there an existing issue for this?
- [X] I have searched the existing issues
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like.
Please add feature to check users online status and last seen
Describe an alternate solution.
NA
Additional context
NA
Hello,
I did something like that:
await page.exposeFunction("contactPresence", async (phoneNumber) => {
await page.waitForSelector('[data-testid="search"]').then(()=> page.click('[data-testid="search"]', {
delay: 0
}));
await page.type("._13NKt.copyable-text.selectable-text[title='Cuadro de texto para ingresar la búsqueda']", phoneNumber);
await page.waitForTimeout(250);
await page.keyboard.press("Enter")
await page.waitForTimeout(1500)
const element = await page.$("._2YPr_.i0jNr");
var text = "";
if (element != null)
text = await page.evaluate(element => element.textContent, element);
return text;
});
Best Regards.
Hello,
I did something like that:
await page.exposeFunction("contactPresence", async (phoneNumber) => { await page.waitForSelector('[data-testid="search"]').then(()=> page.click('[data-testid="search"]', { delay: 0 })); await page.type("._13NKt.copyable-text.selectable-text[title='Cuadro de texto para ingresar la búsqueda']", phoneNumber); await page.waitForTimeout(250); await page.keyboard.press("Enter") await page.waitForTimeout(1500) const element = await page.$("._2YPr_.i0jNr"); var text = ""; if (element != null) text = await page.evaluate(element => element.textContent, element); return text; });
Best Regards.
how to run it?
Hello, I did something like that:
await page.exposeFunction("contactPresence", async (phoneNumber) => { await page.waitForSelector('[data-testid="search"]').then(()=> page.click('[data-testid="search"]', { delay: 0 })); await page.type("._13NKt.copyable-text.selectable-text[title='Cuadro de texto para ingresar la búsqueda']", phoneNumber); await page.waitForTimeout(250); await page.keyboard.press("Enter") await page.waitForTimeout(1500) const element = await page.$("._2YPr_.i0jNr"); var text = ""; if (element != null) text = await page.evaluate(element => element.textContent, element); return text; });
Best Regards.
hey, can u please tell how to run this code.?
I feel like there isnt any context. page isnt defined and as far as my understanding goes does this solution not even use whatsapp-web.js