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...

Комментарии • 112

  • @EBM1
    @EBM1 4 года назад +8

    DAMN THAT LAST PART LMAOOO
    this is exactly what I need, thanks for the important info my guy, hope you have a nice day

  • @curiousSaransh
    @curiousSaransh Год назад

    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 ?

  • @sierioha
    @sierioha 3 года назад +2

    Hi! I have FB chatbot to get customers leeds. Is it possible to make your solution to use phone number instead of title?

  • @junaidshakil1667
    @junaidshakil1667 2 года назад

    its not working the error is:UnhandledPromiseRejectionWarning: TimeoutError: waiting for selector `span [title='Faaiz Zong']` failed: timeout 30000ms exceeded

  • @mrghost6976
    @mrghost6976 3 года назад +5

    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?

    • @stackbeast3885
      @stackbeast3885  3 года назад

      Well you need to build your own system using their apis.. This way u can build own frontend of these services

  • @narasimhashenoy2575
    @narasimhashenoy2575 2 года назад +1

    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

  • @amitdako3243
    @amitdako3243 4 года назад

    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?

  • @VickyKumarMauryaBBB
    @VickyKumarMauryaBBB 2 года назад +1

    Sir , I'm getting timeout error. Like
    TimeoutError: waiting for selector `span [title='Bioengineers @IITJ 😎' ]` failed: timeout 30000ms exceeded

    • @lostsoul2701
      @lostsoul2701 2 года назад

      same issue

    • @tofik7307
      @tofik7307 2 года назад

      replace this two lines : await page.waitForSelector("span[title='name_here']");
      const target = await page.$("span[title='name_here']");

  • @tamilolim
    @tamilolim 2 года назад

    Hi, Is it possible to launch whatsapp headless mode; im try but its throw an error

  • @dmdanushkaDeSilva
    @dmdanushkaDeSilva 3 года назад +1

    I try this code. Its Worked. Thank You

  • @rismanyuslam2909
    @rismanyuslam2909 3 года назад +2

    where the module?

  • @oneoneonenine3104
    @oneoneonenine3104 Год назад

    is there any update of this topic. because this is not working as of now

  • @amitdako3243
    @amitdako3243 4 года назад +1

    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?

    • @stackbeast3885
      @stackbeast3885  4 года назад

      well you can see the log for errors there may be change in whatsapp web ...or you might have missed any part

    • @amitdako3243
      @amitdako3243 4 года назад

      @@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?

  • @nipunsandiluchandrasena5898
    @nipunsandiluchandrasena5898 2 года назад

    Please reply to this massage , how to add this javascript file to html button tag

  • @iben1195
    @iben1195 4 года назад +1

    You: this is really cool, you can Just spam anyone with it
    Your mood: 😆😊😁
    Time: 7:20

  • @petepistol007
    @petepistol007 3 года назад

    So this will allow how to send push notifications to WhatsApp

  • @HK-sw3vi
    @HK-sw3vi 4 года назад +5

    awesome stuff my dude

  • @elmilitar143
    @elmilitar143 2 года назад

    me funciono a la perfeccion, con solo leves retoques, Tanks a lot

  • @harshchauhan6299
    @harshchauhan6299 3 года назад

    Hi how to type in message textbox using javascript
    Element.innerHTML="Hi"
    Button.click()
    But click button doesnt work
    (in textbox of Linkedin)

    • @stackbeast3885
      @stackbeast3885  3 года назад

      try settings input element.value=hii

    • @harshchauhan6299
      @harshchauhan6299 3 года назад

      @@stackbeast3885 thanks for replying
      i am able to write text in textbox
      But send button only works when we press a key from keyboard

    • @stackbeast3885
      @stackbeast3885  3 года назад

      @@harshchauhan6299 you can execute enter event from keyboard.. check for dispatching event in js

    • @harshchauhan6299
      @harshchauhan6299 3 года назад

      @@stackbeast3885 can you come on whats app
      So that i can show the problem ?

  • @yordanibonilla5859
    @yordanibonilla5859 2 года назад

    How do I go about sending an automatic message if its past 10 o clock that says Im sleeping hahaa

  • @anasimloul3714
    @anasimloul3714 2 года назад +1

    does it work in background ?

  • @ghostkee5031
    @ghostkee5031 3 года назад +1

    7:22 wait for the pronunciation of 'with it'

  • @Goofy-n8w
    @Goofy-n8w 3 года назад +1

    where is the link ?

  • @_nurdi_8842
    @_nurdi_8842 3 года назад +1

    (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.

  • @Rohit-gw8tk
    @Rohit-gw8tk Год назад

    Can we use unsaved number?

  • @frajoxn7972
    @frajoxn7972 2 года назад

    Cool, but if i want to send one message evrey 5 min. what i need to insert in for(let i ecc..)?

    • @stackbeast3885
      @stackbeast3885  2 года назад

      You can use setInterval. Without for loop

  • @ilhamvocalovi6879
    @ilhamvocalovi6879 3 года назад +1

    is that only for a private chat? can it use to spamming a group chat??

    • @stackbeast3885
      @stackbeast3885  3 года назад

      yes you can

    • @ilhamvocalovi6879
      @ilhamvocalovi6879 3 года назад

      @@stackbeast3885 Why mine can't?
      I only can spam a private chat.

    • @stackbeast3885
      @stackbeast3885  3 года назад

      @@ilhamvocalovi6879 You may be selecting a diffrent selector for chat..because gropup have different structure. debug it carefully

    • @ilhamvocalovi6879
      @ilhamvocalovi6879 3 года назад

      @@stackbeast3885 No I've select a correct selector, and it still doesnt work

  • @yordanibonilla5859
    @yordanibonilla5859 2 года назад

    the waitforselector method has a timeout so it throws an error hehe

  • @carolinaloaiza2924
    @carolinaloaiza2924 2 года назад

    Thank u so much for this.

  • @AdeTheCoder
    @AdeTheCoder 3 года назад +1

    hi nice video ..can you plz check why i am getting this error.
    TypeError: Cannot read property 'type' of null

    • @akshaymore1991
      @akshaymore1991 3 года назад

      the selected class or element is an array or has multiple elements with the same name u are selecting.

    • @sergiorafaelgallegoseb4024
      @sergiorafaelgallegoseb4024 3 года назад

      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']");
      }

  • @pankajkaushik6244
    @pankajkaushik6244 2 года назад

    Thanks, on every run of this program system will ask to scan the qr code

  • @Umishashah
    @Umishashah 2 года назад

    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.

    • @stackbeast3885
      @stackbeast3885  2 года назад

      yes You can check , find the selector for status field and check if its content is online or not

  • @mixsoftwaresnei6329
    @mixsoftwaresnei6329 4 года назад +3

    plis soucer code

  • @anshuvishwakarma6020
    @anshuvishwakarma6020 3 года назад

    How to send any attachment to this.

  • @smitdhimar1884
    @smitdhimar1884 2 года назад

    Err:require is not defined

  • @dolevdo
    @dolevdo 3 года назад +1

    instead of sending the same massage to the same person 70 times
    i want to send the same message to 70 different people

    • @usfeed4902
      @usfeed4902 3 года назад

      @@kunalsinghal4122 for me it only open whatsapp and contact but it doesn't send msg !

  • @NiceGuy1811
    @NiceGuy1811 3 года назад +3

    Nice man!

  • @jonathanbalasingh9823
    @jonathanbalasingh9823 3 года назад

    Hi, how can we send documents?

  • @MaximilianoMontenegroAlejo
    @MaximilianoMontenegroAlejo 4 года назад +2

    Hello, excellent post.
    A query ... How can I read the messages from server.js to be able to answer them?
    Thank you very much...

    • @stackbeast3885
      @stackbeast3885  4 года назад +1

      well you can just find the selector of the message by inspecting and read that

    • @MaximilianoMontenegroAlejo
      @MaximilianoMontenegroAlejo 4 года назад

      @@stackbeast3885 please, do you help me for this?

  • @marollicconsulting6381
    @marollicconsulting6381 2 года назад +1

    Hi, its possible send audio?

  • @alfianyudapratama2967
    @alfianyudapratama2967 3 года назад

    how to add interval on this script

  • @phillipemarques2321
    @phillipemarques2321 3 года назад +2

    It worked! Thanks

  • @prasadpadi6937
    @prasadpadi6937 Год назад

    Hi, how can we send images?

  • @drink2go.izcalli
    @drink2go.izcalli 3 года назад +1

    how to do it without NODE?

    • @stackbeast3885
      @stackbeast3885  3 года назад

      you may use a browser... and open console.. and paste some script there.. that can also do this..

  • @topahokya6621
    @topahokya6621 4 года назад

    bro this doesnt msg in whatsapp group , only works in personal messages with single person

    • @stackbeast3885
      @stackbeast3885  4 года назад

      Well, we will have to make some changes probably in classes selector , This can be made to group as well

  • @dolevdo
    @dolevdo 3 года назад

    is it possible to make it send 1 message for the 70 first contacts ?

    • @stackbeast3885
      @stackbeast3885  3 года назад

      yes sure

    • @dolevdo
      @dolevdo 3 года назад

      @@stackbeast3885 can u give me a little hint on how can i make it send the message to 70 different people ?

  • @VloggerVish
    @VloggerVish 3 года назад

    Can't we send message via already open browser...

    • @stackbeast3885
      @stackbeast3885  3 года назад

      you can ... see for opening different chrome using pupeteer

    • @VloggerVish
      @VloggerVish 3 года назад

      @@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

    • @stackbeast3885
      @stackbeast3885  3 года назад

      will have to checkout.. havnt tried that

  • @NamanTGGAllHailTGG
    @NamanTGGAllHailTGG 4 года назад +1

    Do. i have to download anything for this?

    • @stackbeast3885
      @stackbeast3885  4 года назад

      only node js ,puppetter

    • @namanxai
      @namanxai 4 года назад +2

      how do i download puppetter

    • @stackbeast3885
      @stackbeast3885  4 года назад

      you can run .. npm i puppetter,, or check my scrapping videos for better understanding

  • @ranveerverma9740
    @ranveerverma9740 4 года назад

    Nice , I will try this

  • @Codeyoncom
    @Codeyoncom Год назад

    Thnen he got a popup "Your whatsapp Number is banned from using whatsapp Have a bad day" :D

  • @mixsoftwaresnei6329
    @mixsoftwaresnei6329 4 года назад +1

    please put the source code in the description of the friend video

  • @shaonkabir8
    @shaonkabir8 4 года назад +1

    Amazing 😍😍😍

  • @dolevdo
    @dolevdo 3 года назад +1

    oMG amazing !!,

  • @raviduttjangid7304
    @raviduttjangid7304 2 года назад

    how to send bulk message

    • @stackbeast3885
      @stackbeast3885  2 года назад

      You can keep message and users electors in array..

  • @bala-st9cj
    @bala-st9cj 3 года назад

    Is this possible to send multiple users ?

  • @michelemarchili9018
    @michelemarchili9018 3 года назад

    it tells me it can't find modules

    • @stackbeast3885
      @stackbeast3885  3 года назад

      may be issue with npm library not installed properly.. try npm i again

  • @rajinderverma1324
    @rajinderverma1324 4 года назад

    Usefull must try

  • @luisforni86
    @luisforni86 3 года назад

    Hello, very good. How can I save the cookie?

  • @linux..
    @linux.. 2 года назад

    using which ide

  • @jaisankare1352
    @jaisankare1352 3 года назад +1

    Bro, how to pre-set time?

  • @Staticgkzone
    @Staticgkzone 2 года назад

    Kya kar raha ha kya bata raha ha kuch bhe Matlab Kuch bhe🙄

  • @rogercolque
    @rogercolque 3 года назад

    there is a risk of get banned me for this. ?

  • @studyharshal4244
    @studyharshal4244 3 года назад

    Can you make app for me i will pay for it

  • @neerajkrishnakumar116
    @neerajkrishnakumar116 4 года назад +1

    Please give link to your previous video

    • @stackbeast3885
      @stackbeast3885  4 года назад

      hii there, well you can check the playlist on my channel for web scrapping related

  • @dolevdo
    @dolevdo 3 года назад

    message ***

  • @curioussekhar5598
    @curioussekhar5598 3 года назад

    hi nice video ..can you plz check why i am getting this error.
    TypeError: Cannot read property 'type' of null