whatsapp-bot-with-puppeteer
所属分类:视频/语音聊天
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2023-09-29 18:56:17
上 传 者:
sh-1993
说明: 使用Puppeter自动化WhatsApp消息。以编程方式发送有趣的消息!,
(Automate WhatsApp messages with Puppeteer. Send fun messages programmatically!,)
文件列表:
LICENSE (1069, 2023-09-29)
index.js (2998, 2023-09-29)
package-lock.json (57813, 2023-09-29)
package.json (137, 2023-09-29)
# WhatsApp Puppeteer Bot
## Overview
This project is a simple WhatsApp automation script using Puppeteer. It leverages Puppeteer's capabilities to send messages on WhatsApp programmatically.
## Features
- Launches a headless browser with Puppeteer.
- Navigates to WhatsApp Web (http://web.whatsapp.com).
- Waits for the user to log in by adding a delay.
- Sends a series of messages to a specified chat, demonstrating message automation.
- Includes a final message to let the recipient know it's a fun project.
## How to Use
1. Clone the repository and Install dependencies:
```bash
git clone https://github.com/sunjay-dev/whatsapp-bot-with-puppeteer.git
cd whatsapp-bot-with-puppeteer
npm install
```
2. Run the script:
```bash
node index.js
```
### Note on Node Modules
This project includes `package.json`, `package-lock.json`, and `node_modules` in version control. While this practice is not typical due to the potential size of the `node_modules` directory, it has been included to simplify setup for users.
It's recommended to use `npm install` to fetch the dependencies locally and ensure compatibility. If needed, you can choose to exclude `node_modules` from version control by modifying the `.gitignore` file.
### How to find the `executablePath` for Google Chrome, you can follow these steps:
1. **Windows:**
- Right-click on the Google Chrome shortcut on your desktop or in the Start menu.
- Select "Properties" from the context menu.
- In the "Shortcut" tab, you will see a field labeled "Target."
- Copy the text in the "Target" field. It should look something like this:
```
"C:\Program Files\Google\Chrome\Application\chrome.exe"
```
- Use this path as the `executablePath` in your Puppeteer configuration.
2. **macOS:**
- Open a terminal.
- Run the following command:
```bash
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
```
- Copy the path returned by this command and use it as the `executablePath` in your Puppeteer configuration.
3. **Linux:**
- Open a terminal.
- Run the following command:
```bash
which google-chrome
```
- Copy the path returned by this command and use it as the `executablePath` in your Puppeteer configuration.
## Important Note
This script is for educational and demonstrative purposes only. It's crucial to use automation scripts responsibly and within the terms of service of the platforms you interact with.
## Contributing
Feel free to contribute to the project by opening issues or submitting pull requests.
## License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/sunjay-dev/whatsapp-bot-with-puppeteer/blob/master/LICENSE) file for details.
近期下载者:
相关文件:
收藏者: