The project is going to be archived as I am not able to actively maintain it, and the whatsapp web code have changed a lot.
WhatsApp Web automation using javascript
Can get and select chats by name
Open WhatsApp Web. Copy infiny script, select a chat with
selectContact("Mommy")
Then send a message to the contact with
sendMessage("Hey mommy, i can use the console!")