Code Monkey home page Code Monkey logo

wawebsessionhandler's Introduction

WaWebSessionHandler

Save WhatsApp Web Sessions to files and run them everywhere!

Requirements:

If you want to run the .py file you will need:

  • Chrome or Firefox
  • Selenium (pip install selenium)
  • Chromedriver and/or Geckodriver
    • copy them in the same folder as the scrip, or put them in PATH
    • Note: Make sure they can be executed by the script

How to use:

You could simply run "WaWebSession.py" and use it as a script, or import the "SessionHandler"-Class in your own script and work with it that way.

Class(es) and Methods:

  • wa_sh = WaWebSession.SessionHandler() -> creates a new instance of the SessionHandler
    • you can also specify two optional parameters:
      • browser -> can be Browser.CHROME or Browser.FIREFOX
      • log_level -> can be a level of the logging module, or a string of the wanted level
  • wa_sh.set_browser(browser) -> change the browser used by this class
  • wa_sh.set_log_level(log_level) -> change the log_level of this module
  • wa_sh.create_new_session() -> extracts a new WaWebProfile from a temporary browser session (login prompt)
    • returns a list with all stored IDB user objects (also referred to as: WaWebSession object, profile_obj, session_obj)
  • wa_sh.get_active_session() -> gets all active sessions from the browser
    • you can also specify a profile by using the "profile" parameter passing a single name, or a list of profile names to it
    • returns a dict that looks like this: {profile_name: profile_obj}
  • wa_sh.access_by_obj(profile_obj) -> starts the provided session in a browser window
  • wa_sh.access_by_file(filepath) -> starts the provided session in a browser window
  • wa_sh.save_profile(profile_obj, filepath) -> creates a session file from a profile_obj
    • you can also save multiple profiles by providing a dict like the one returned by get_active_session()
    • filepath can be a relative or absolute path

IDB user object file:

  • session objects are stored in a list
  • the items in the list are dicts looking like this: {"key": entry_key, "value": entry_value}
  • the list is extracted from the "user" objectStore of the WhatsApp Web page

wawebsessionhandler's People

Contributors

jeliebig avatar

Watchers

 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.