Git Product home page Git Product logo

webwhatsapi's Introduction

WebWhatsAPI (Based on web.whatsapp.com)

What is it?

This package is used to provide a python interface for interacting with WhatsAPP Web to send and receive Whatsapp messages.

Installation

Dependencies

You will need to install Gecko Driver separately, if using firefox, which is the default.

From Source

  • Clone the repository
  • Use `pip install -r requirements.txt' to install the required packages.

From PyPI

  • Install from pip pip install webwhatsapi

Usage

  1. Import library from webwhatsapi import WhatsAPIDriver

  2. Instantiate driver and set username driver = WhatsAPIDriver(username="mkhase") Possible arguments for constructor:

    • client : Type of browser. The default is Firefox, but Chrome and Remote is supported too.
    • username : Can be any value.
    • proxy: The proxy server to configure selenium to. Format is ":"
    • command executor: Passed directly as an argument to Remote Selenium. Ignore if not using it.
    • loadstyle: Default is true. If true, doesn't load the styling in the browser.
    • profile: Pass the full path to the profile to load it. Profile folder will be end in ".default". For persistent login, open a normal firefox tab, log in to whatsapp, then pass the profile as an argument.
  3. Use the get_qrcode() function to save the QR code in a file, for remote clients, so that you can access them easily. Scan the QR code either from the file, or directly from the client to log in. driver.get_qr()

  4. In case the QR code expires, you can use the reload_qr function to reload it driver.reload_qr()

  5. Viewing unread messages driver.view_unread()

  6. Viewing all contacts driver.get_all_chats()

  7. To send a message, get a Contact object, and call the send_message function with the message. <Contact Object>.send_message("Hello")

Limitation

Phone has to be on and connected to the internet

Capabilities

  • Read recent messages
  • Get unread messages
  • Send text messages
  • Get List of Contacts
  • Get List of Groups
  • Get information about Groups
  • Get various events. For example: Leaving, Joining, Missed Call etc.
  • Download media messages
  • Get List of common groups
  • Asyncio driver version

Note:

There are issues with asynchronous calls in Chrome. Primary support of this api is for firefox. If something doesn't work in chrome, please try firefox.

Known issues with chrome:

  • Group Metadata

For more queries, contact: [email protected]

Contribute

Contributing is simple as cloning, making changes and submitting a pull request. If you would like to contribute, here are a few starters:

  • Bug Hunts
  • More sorts of examples
  • Additional features/ More integrations (This api has the minimum amount, but I don't mind having more data accessible to users)
  • Create an env/vagrant box to make it easy for others to contribute. (At the moment, all I have is a requirements.txt
  • Phantom JS support

webwhatsapi's People

Contributors

adarshsanjeev avatar alfred82santa avatar azixus avatar cedriczirtacic avatar codemanat avatar lucasrcezimbra avatar mukulhase avatar prehensilebbc avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.