Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enter button is not working after sending message to first contact #32

Open
yashthaker7 opened this issue Oct 10, 2021 · 1 comment
Open

Comments

@yashthaker7
Copy link

Hi,
I'm using version 1.1.16
Node version v11.12.0
Mac os big surr 11.2.1

Message sent successfully in logs but not showing in app. just first contact get the message.
I open the browser (showBrowser:true), I see the message initialisation for second contact and onwards but send button in not clicking

I check SEND_BUTTON in node_modules/wbm/src/api.js
SEND_BUTTON: 'div:nth-child(2) > button > span[data-icon="send"]'

I also try with delay page.waitFor(5000) but not working

@Guyc1800
Copy link

Hi, I'm using version 1.1.16 Node version v11.12.0 Mac os big surr 11.2.1

Message sent successfully in logs but not showing in app. just first contact get the message. I open the browser (showBrowser:true), I see the message initialisation for second contact and onwards but send button in not clicking

I check SEND_BUTTON in node_modules/wbm/src/api.js SEND_BUTTON: 'div:nth-child(2) > button > span[data-icon="send"]'

I also try with delay page.waitFor(5000) but not working

async function sendTo(phoneOrContact, message) {
let phone = phoneOrContact;
if (typeof phoneOrContact === "object") {
phone = phoneOrContact.phone;
message = generateCustomMessage(phoneOrContact, message);
}
try {
process.stdout.write("Sending Message...\r");
await page.goto(https://web.whatsapp.com/send?phone=${phone}&text=${encodeURIComponent(message)});
await page.waitForSelector(SELECTORS.LOADING, { hidden: true, timeout: 60000 });
await page.waitForSelector(SELECTORS.SEND_BUTTON, { timeout: 10000 });
await page.evaluate((SELECTORS)=>{
document.querySelector(SELECTORS.SEND_BUTTON).click()
},SELECTORS)
process.stdout.clearLine();
process.stdout.cursorTo(0);
process.stdout.write(${phone} Sent\n);
counter.success++;
} catch (err) {
process.stdout.clearLine();
process.stdout.cursorTo(0);
process.stdout.write(${phone} Failed\n);
counter.fails++;
}
}

replace with this function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants