Send WhatsApp Messages using javascript | Whatsapp Automation puppeteer
HTML-код
- Опубликовано: 11 сен 2024
- #javascript #puppeteer #webscrapping #wahtsappbot
Sending WhatsApp Messages using javascript using node js library puppeteer
Link of Source Code:
github.com/vik...
DAMN THAT LAST PART LMAOOO
this is exactly what I need, thanks for the important info my guy, hope you have a nice day
I got a logout pending problem .... While logging out the WhatsApp,, Can you solve this for me and then it got vanished,, is it logged out or not ?
Hi! I have FB chatbot to get customers leeds. Is it possible to make your solution to use phone number instead of title?
its not working the error is:UnhandledPromiseRejectionWarning: TimeoutError: waiting for selector `span [title='Faaiz Zong']` failed: timeout 30000ms exceeded
Hello Sir, you are great ! thanks for giving this tutorial. I want to ask something. Can I change Frontend of a website for all users like in Whatsapp or Google Meet?
Well you need to build your own system using their apis.. This way u can build own frontend of these services
really nice and helpful video. I have one question. can we send messages to unknown contacts, I mean the query selector will return null if it is not there in the recent chats
hey, if i use node js for 32 bytes it open the whatsapp but doesnt enter to conversation and sand somthing , and if i work with the 64 bytes node js so it doesnt show error but allso doesnt open nothing, what should i do?
Sir , I'm getting timeout error. Like
TimeoutError: waiting for selector `span [title='Bioengineers @IITJ 😎' ]` failed: timeout 30000ms exceeded
same issue
replace this two lines : await page.waitForSelector("span[title='name_here']");
const target = await page.$("span[title='name_here']");
Hi, Is it possible to launch whatsapp headless mode; im try but its throw an error
I try this code. Its Worked. Thank You
where the module?
is there any update of this topic. because this is not working as of now
hey, i did it and its just open whatsapp for me, it doesnt open the chat that i want and doesnt sand a massage to anyone, you now why?
well you can see the log for errors there may be change in whatsapp web ...or you might have missed any part
@@stackbeast3885 const puppeteer = require("puppeteer");
async function scrape(url) {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto(url);
await page.waitForSelector("span [title='Dad']");
const target = await page.$("span [title='Dad']");
await target.click();
const inp = await page.$(
"#main > footer > div._3ee1T._1LkpH.copyable-area > div._3uMse > div > div._3FRCZ.copyable-text.selectable-text"
);
for (let i = 0; i < 100; i++) {
await inp.type("ok this is magic");
await page.keyboard.press("Enter");
}
}
scrape("web.whatsapp.com");
this is what i used, do i have some error?
Please reply to this massage , how to add this javascript file to html button tag
You: this is really cool, you can Just spam anyone with it
Your mood: 😆😊😁
Time: 7:20
So this will allow how to send push notifications to WhatsApp
awesome stuff my dude
me funciono a la perfeccion, con solo leves retoques, Tanks a lot
Hi how to type in message textbox using javascript
Element.innerHTML="Hi"
Button.click()
But click button doesnt work
(in textbox of Linkedin)
try settings input element.value=hii
@@stackbeast3885 thanks for replying
i am able to write text in textbox
But send button only works when we press a key from keyboard
@@harshchauhan6299 you can execute enter event from keyboard.. check for dispatching event in js
@@stackbeast3885 can you come on whats app
So that i can show the problem ?
How do I go about sending an automatic message if its past 10 o clock that says Im sleeping hahaa
does it work in background ?
Yes you can make it run headlesa
7:22 wait for the pronunciation of 'with it'
where is the link ?
(node:7476) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'type' of null
at scrape (c:\Users\User\Desktop\Nurkeldi\Microsoft VS Code\work\New\tempCodeRunnerFile.js:15:15)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7476) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7476) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I have the same problem
did you find a solution?
Can we use unsaved number?
Cool, but if i want to send one message evrey 5 min. what i need to insert in for(let i ecc..)?
You can use setInterval. Without for loop
is that only for a private chat? can it use to spamming a group chat??
yes you can
@@stackbeast3885 Why mine can't?
I only can spam a private chat.
@@ilhamvocalovi6879 You may be selecting a diffrent selector for chat..because gropup have different structure. debug it carefully
@@stackbeast3885 No I've select a correct selector, and it still doesnt work
the waitforselector method has a timeout so it throws an error hehe
Thank u so much for this.
hi nice video ..can you plz check why i am getting this error.
TypeError: Cannot read property 'type' of null
the selected class or element is an array or has multiple elements with the same name u are selecting.
for (let i = 0; i < 1000; i++) {
await page.evaluate(() => {
const message = "rsadfsdft(";
document.execCommand("insertText", false, message);
});
await page.click("span[data-testid='send']");
}
Thanks, on every run of this program system will ask to scan the qr code
Nice work done, Is it possible to check if user is online or not at frequent interval ? in your example if i could check if 'Ek Villian' is online or not.
yes You can check , find the selector for status field and check if its content is online or not
plis soucer code
How to send any attachment to this.
Err:require is not defined
instead of sending the same massage to the same person 70 times
i want to send the same message to 70 different people
@@kunalsinghal4122 for me it only open whatsapp and contact but it doesn't send msg !
Nice man!
Hi, how can we send documents?
Hello, excellent post.
A query ... How can I read the messages from server.js to be able to answer them?
Thank you very much...
well you can just find the selector of the message by inspecting and read that
@@stackbeast3885 please, do you help me for this?
Hi, its possible send audio?
Yes u can
how to add interval on this script
It worked! Thanks
Hi, how can we send images?
how to do it without NODE?
you may use a browser... and open console.. and paste some script there.. that can also do this..
bro this doesnt msg in whatsapp group , only works in personal messages with single person
Well, we will have to make some changes probably in classes selector , This can be made to group as well
is it possible to make it send 1 message for the 70 first contacts ?
yes sure
@@stackbeast3885 can u give me a little hint on how can i make it send the message to 70 different people ?
Can't we send message via already open browser...
you can ... see for opening different chrome using pupeteer
@@stackbeast3885 I mean the current code opens browser every time it runs.. but can give a check if browser already open just send message...no need to open another browser Instance
will have to checkout.. havnt tried that
Do. i have to download anything for this?
only node js ,puppetter
how do i download puppetter
you can run .. npm i puppetter,, or check my scrapping videos for better understanding
Nice , I will try this
Thnen he got a popup "Your whatsapp Number is banned from using whatsapp Have a bad day" :D
please put the source code in the description of the friend video
ok , i am updating the description
Amazing 😍😍😍
Glad you like it
oMG amazing !!,
how to send bulk message
You can keep message and users electors in array..
Is this possible to send multiple users ?
yes.. you can multiple users selector
it tells me it can't find modules
may be issue with npm library not installed properly.. try npm i again
Usefull must try
Hello, very good. How can I save the cookie?
using which ide
Vs code
Bro, how to pre-set time?
Kya kar raha ha kya bata raha ha kuch bhe Matlab Kuch bhe🙄
there is a risk of get banned me for this. ?
no
Can you make app for me i will pay for it
Please give link to your previous video
hii there, well you can check the playlist on my channel for web scrapping related
message ***
hi nice video ..can you plz check why i am getting this error.
TypeError: Cannot read property 'type' of null
Where in the code?