#How to get contact info from a open chat in WhatsApp web?

11 messages · Page 1 of 1 (latest)

glad sapphire
#

Hey guys, I'm having issues to develop my final project for college which is to create an app for an application that already exists and my group was choosen to work with Whatsapp.

We only need to make a MVP, I have been using wwebjs lib for testing and I'm able to send messages thought my app web. But now the only thing that is missing is to get the information once I open a random chat in whatsapp web, and I couldnt see a method on this lib to help me on this.

Also, is there a way to connect to whatsapp web js directly to Whatsapp Web? without logging everytime with qr code from the lib?

Thanks guys.

chrome kettle
glad sapphire
#

does the getContact only apply when someone messages you? the latest message will return the contact?

#

Im looking for something like an event when Im working with WhatsApp Web and click in an open chat, not sure if there is a solution for that

#

I also thought to do a query selector to get the header

chrome kettle
#

Don't be shy, take a time to read the documentation

glad sapphire
#

sorry @chrome kettle I believe I didnt make myself clear with my question, let me redo,

getContacts and getContactById are methods that I have already tested and worked as expected, the feature I'm looking is about the active open chat in WhatsApp, I did a quick research in portuguese channel and I could see there was a previous conversation about it. I have attached.

Unfortunately I'm not familiar so much with frontend, but if this solution is known and have documented, that will be really helpful, this is the only thing that is missing for my project.

#

I've tried to use pupPage to get the data, but no success

chrome kettle
#

I see, I think you didn't understand how this lib works, it's a backend lib, and it works without a direct iteration with the browser, it uses the browser only to have access to the methods behind the scenes