# General

<figure><img src="/files/onJ1jCQlqbwp0Qa4SNlN" alt=""><figcaption></figcaption></figure>

### General

***Unstable , unreliable , minimalist Zalo Scraper library for Nodejs***

#### About The Project <a href="#about-the-project" id="about-the-project"></a>

ZaloJS is a powerful high-level scraping API designed for accessing data from Zalo, a popular messaging platform in Vietnam. This versatile tool provides developers with the means to extract various types of data from Zalo, enabling them to build applications, gather insights, and automate tasks effectively.

**Use Cases**

* Chatbot Development: Develop chatbots capable of interacting with Zalo users, responding to messages, providing information, and executing tasks.
* Automated Workflows: Streamline repetitive tasks by automating actions within the Zalo client, such as sending notifications or gathering data.

**Example Use**

```javascript
const { init } = require('zalojs');
const config = require('./config.json');
const Client = require('zalojs').default;
const fs = require('fs');
const path = require('path');

const prefix = '!';

(async () => {
  const { browser, page } = await init({
    groupName: config.gname,
    groupID: config.gselector,
    headless: config.headless,
  });

  const client = new Client(page);

  client.on('message', async (message) => {

    if (!message.content.startsWith(prefix)) return;
    const args = message.content.slice(prefix.length).trim().split(/ +/);
    const commandName = args.shift().toLowerCase();

    try {
    if (command === 'ping') {
      await client.send({ message :'!Pong' });
    }
    } catch (error) {
      console.log(error);
      await client.send({ message :'There was an error executing the command.' });
    }
  });

  client.once('ready', () => {
    console.log(`Bot is ready! ${client.user.name}`);
  });
})();
```

[NextGetting Started](https://3040133522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPeifOhXAyI8EOHuWYxvB%2Fuploads%2FIj1NfbYhYUv5Jieksfsl%2Fgetting%20started?alt=media)

Last updated 3 days ago


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zalojs.gitbook.io/docs-1/general.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
