GithubHelp home page GithubHelp logo

ankit404butfound / pywhatkit Goto Github PK

View Code? Open in Web Editor NEW
1.3K 31.0 282.0 2.58 MB

Send WhatsApp message at certain time and many other things.

License: MIT License

Python 100.00%
pywhatkit hacktoberfest-accepted hacktoberfest2021 hacktoberfest

pywhatkit's Introduction

image

image image image image image image image image

I am a bit busy and not able to keep up with the issues, I am looking for active collaborators, please contact me if you are interested.

PyWhatKit is a Python library with various helpful features. It's easy-to-use and does not require you to do any additional setup. Currently, it is one of the most popular library for WhatsApp and YouTube automation. New updates are released frequently with new features and bug fixes.

Links

Installation and Supported Versions

PyWhatKit is available on PyPi:

python3 -m pip install pywhatkit
pip3 install pywhatkit

PyWhatKit officially supports Python 3.8+.

Cloning the Repository

git clone https://github.com/Ankit404butfound/PyWhatKit.git

What's new in v5.4?

Fix Flask import error

What's new in v5.3?

import pywhatkit
pywhatkit.start_server()

This method can be used to remotely control your PC using your phone (Windows only)

  • Make sure your PC and your phone are on same network, on your PC, Open Network and Internet Settings > Properties > Network Profile, make sure it's set to Private.
  • Run the above code and then open command prompt and type ipconfig.
  • Search for IPv4 Address and on your phone's browser type this address and append :8000 at the end, example 192.168.0.1:8000.
  • Try moving you finger and you should notice your cursor moving too.
  • You can also type and scroll too, enjoy.
  • More information here https://pywhatkit.herokuapp.com/remote-kit with the raw code.

Features

  • Sending Message to a WhatsApp Group or Contact
  • Sending Image to a WhatsApp Group or Contact
  • Converting an Image to ASCII Art
  • Converting a String to Handwriting
  • Playing YouTube Videos
  • Sending Mails with HTML Code
  • Install and Use

Usage

import pywhatkit

# Send a WhatsApp Message to a Contact at 1:30 PM
pywhatkit.sendwhatmsg("+910123456789", "Hi", 13, 30)

# Same as above but Closes the Tab in 2 Seconds after Sending the Message
pywhatkit.sendwhatmsg("+910123456789", "Hi", 13, 30, 15, True, 2)

# Send an Image to a Group with the Caption as Hello
pywhatkit.sendwhats_image("AB123CDEFGHijklmn", "Images/Hello.png", "Hello")

# Send an Image to a Contact with the no Caption
pywhatkit.sendwhats_image("+910123456789", "Images/Hello.png")

# Send a WhatsApp Message to a Group at 12:00 AM
pywhatkit.sendwhatmsg_to_group("AB123CDEFGHijklmn", "Hey All!", 0, 0)

# Send a WhatsApp Message to a Group instantly
pywhatkit.sendwhatmsg_to_group_instantly("AB123CDEFGHijklmn", "Hey All!")

# Play a Video on YouTube
pywhatkit.playonyt("PyWhatKit")

# Converting image to ASCII Art
  ascii_art = pywhatkit.image_to_ascii_art("image path")
  print(ascii_art)

For more Examples and Functions, have a look at the Wiki.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Be sure to read the Guidelines before Contributing.

License

MIT. For more information see this

pywhatkit's People

Contributors

aaryanrr avatar abijanu101 avatar ankit404butfound avatar bharathbrat avatar chaitanyasinghbisht avatar charanleo25 avatar codewithpom avatar debadritocg avatar dependabot[bot] avatar dev-essbee avatar dipadityadas avatar gautamkrishnar avatar george72 avatar kineolyan avatar leadersheir avatar leninelio avatar mohamedaly8 avatar ns23k avatar phoenixcreation avatar shravanasati avatar shubhamgrg04 avatar siddhesh-agarwal avatar sigireddybalasai avatar sonumahajan avatar subhodip1307 avatar uknowwhoim avatar vashesh08 avatar viditpandey06 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pywhatkit's Issues

NO INTERNET - Pywhatkit needs active internet connection

Hello,

I am having problems using PyWhatKit on a Desktop that works on a proxy.
The message always appears, whatever the script used:

"ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1124)"
"urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1124)')))"
"pywhatkit.mainfunctions.InternetException: NO INTERNET - Pywhatkit needs active internet connection"

How can I resolve this issue? The desktop works in a proxy, but has free access to the internet.

Thank you.

Desktop (please complete the following information):

  • OS: Windows 7
  • Browser Chrome
  • Version 88.0.4324.146

Close webwhatsapp after a message is sent

Hello,

I use the library to automate something like a bot.

After I sent out 20 messages, the browser get's kinda slow because of all the opened windows.

It would be nice to tell the browser to close the window after it has successfully send the message.

Return status if cell number is invalid

Is there a way to return a status when the message was not sent? For example, the mobile number does not exist or is invalid or not a valid whatsapp number.

Thanks

Sem título
.

Support for utf8 submission (text_to_handwriting)

The program is great. It would be really cool if it had support for custom encodes.
For example, to send in "pt-br" the utf-8 encode would be necessary.

Text example: "Quem dá e tira com o diabo fica, sua mão se danifica, sua vó será maldita, e sua sogra ressuscita."
Output:
image

Misspelled Function Description

The function image_to_ascii_art() is having a misspelled description when i installed the module but when i saw that same file here on the repository it was spelled correctly. The file where this function is declared is having this misspelled description.

Steps to reproduce the behavior:

  1. Install pywhatkit in a virtual environment. (I haven't tested it )
  2. Create a python file and import pywhatkit.
  3. Access the image_to_ascii_art() function and hover over it to see the description.

Expected behavior
The function description says Converts the given image to ascii art and save it to uotput_file but it should be correctly spelled as it is given in the repository.

Screenshots

Screenshot (28)

Screenshot (29)

**Desktop **

  • OS: Windows 10 Version 1909
  • Browser: Microsoft Edge
  • Version: 87.0.664.

Python Related Details
Version: 3.9.1
Pip Version: 20.3.3

Additional context
I know that this isn't anything related to any error but I want to know why is this happening and is it happening to me only or someone else too.

Error when installing with pip

Describe the bug
I have tried to install the package via pip: https://pypi.org/project/pywhatkit/
and go the following errors:

`pip install pywhatkit
Collecting pywhatkit
Downloading pywhatkit-4.8-py3-none-any.whl (11 kB)
Collecting pyautogui
Downloading PyAutoGUI-0.9.52.tar.gz (55 kB)
|████████████████████████████████| 55 kB 524 kB/s
Collecting wikipedia
Downloading wikipedia-1.4.0.tar.gz (27 kB)
Collecting requests
Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB)
Collecting Pillow
Using cached Pillow-8.2.0-cp38-cp38-manylinux1_x86_64.whl (3.0 MB)
Collecting PyTweening>=1.0.1
Downloading PyTweening-1.0.3.zip (15 kB)
Collecting mouseinfo
Downloading MouseInfo-0.1.3.tar.gz (10 kB)
Collecting pygetwindow>=0.0.5
Downloading PyGetWindow-0.0.9.tar.gz (9.7 kB)
Collecting pymsgbox
Downloading PyMsgBox-1.0.9.tar.gz (18 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting pyscreeze>=0.1.21
Downloading PyScreeze-0.1.27.tar.gz (25 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting python3-Xlib
Downloading python3-xlib-0.15.tar.gz (132 kB)
|████████████████████████████████| 132 kB 1.5 MB/s
Collecting beautifulsoup4
Downloading beautifulsoup4-4.9.3-py3-none-any.whl (115 kB)
|████████████████████████████████| 115 kB 3.3 MB/s
Collecting certifi>=2017.4.17
Using cached certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
Collecting urllib3<1.27,>=1.21.1
Using cached urllib3-1.26.5-py2.py3-none-any.whl (138 kB)
Collecting idna<3,>=2.5
Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting chardet<5,>=3.0.2
Using cached chardet-4.0.0-py2.py3-none-any.whl (178 kB)
Collecting pyperclip
Downloading pyperclip-1.8.2.tar.gz (20 kB)
Collecting pyrect
Downloading PyRect-0.1.4.tar.gz (15 kB)
Collecting soupsieve>1.2; python_version >= "3.0"
Downloading soupsieve-2.2.1-py3-none-any.whl (33 kB)
Building wheels for collected packages: pyautogui, wikipedia, PyTweening, mouseinfo, pygetwindow, pymsgbox, pyscreeze, python3-Xlib, pyperclip, pyrect
Building wheel for pyautogui (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/david/whatsapp/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nvgwm6ep/pyautogui/setup.py'"'"'; file='"'"'/tmp/pip-install-nvgwm6ep/pyautogui/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-jn57uvt7
cwd: /tmp/pip-install-nvgwm6ep/pyautogui/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'bdist_wheel'

ERROR: Failed building wheel for pyautogui
Running setup.py clean for pyautogui
Building wheel for wikipedia (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/david/whatsapp/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nvgwm6ep/wikipedia/setup.py'"'"'; file='"'"'/tmp/pip-install-nvgwm6ep/wikipedia/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-867z4620
cwd: /tmp/pip-install-nvgwm6ep/wikipedia/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'bdist_wheel'

ERROR: Failed building wheel for wikipedia
Running setup.py clean for wikipedia
Building wheel for PyTweening (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/david/whatsapp/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nvgwm6ep/PyTweening/setup.py'"'"'; file='"'"'/tmp/pip-install-nvgwm6ep/PyTweening/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ojo5ezjc
cwd: /tmp/pip-install-nvgwm6ep/PyTweening/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'bdist_wheel'

ERROR: Failed building wheel for PyTweening
Running setup.py clean for PyTweening
Building wheel for mouseinfo (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/david/whatsapp/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nvgwm6ep/mouseinfo/setup.py'"'"'; file='"'"'/tmp/pip-install-nvgwm6ep/mouseinfo/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-94zepy2y
cwd: /tmp/pip-install-nvgwm6ep/mouseinfo/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'bdist_wheel'

ERROR: Failed building wheel for mouseinfo
Running setup.py clean for mouseinfo
Building wheel for pygetwindow (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/david/whatsapp/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nvgwm6ep/pygetwindow/setup.py'"'"'; file='"'"'/tmp/pip-install-nvgwm6ep/pygetwindow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-oomlt_69
cwd: /tmp/pip-install-nvgwm6ep/pygetwindow/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'bdist_wheel'

ERROR: Failed building wheel for pygetwindow
Running setup.py clean for pygetwindow
Building wheel for pymsgbox (PEP 517) ... done
Created wheel for pymsgbox: filename=PyMsgBox-1.0.9-py3-none-any.whl size=7420 sha256=e186970f32edd29b1559db3d4085a12477b7e92409d2ee8fe69b1566e330a558
Stored in directory: /home/david/.cache/pip/wheels/91/28/0d/f4eb606d38276836237d6dc2abf094241e6db5682a126e0389
Building wheel for pyscreeze (PEP 517) ... done
Created wheel for pyscreeze: filename=PyScreeze-0.1.27-py3-none-any.whl size=12891 sha256=234edc389e2225a8c2fdf64431eb0a092c618c8ec832009989f7c9b4e33041e1
Stored in directory: /home/david/.cache/pip/wheels/f7/91/eb/c0fa176c095c77460a579ef339f24a377474b041e5543d1a00
Building wheel for python3-Xlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/david/whatsapp/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nvgwm6ep/python3-Xlib/setup.py'"'"'; file='"'"'/tmp/pip-install-nvgwm6ep/python3-Xlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ah0gdsnx
cwd: /tmp/pip-install-nvgwm6ep/python3-Xlib/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'bdist_wheel'

ERROR: Failed building wheel for python3-Xlib
Running setup.py clean for python3-Xlib
Building wheel for pyperclip (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/david/whatsapp/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nvgwm6ep/pyperclip/setup.py'"'"'; file='"'"'/tmp/pip-install-nvgwm6ep/pyperclip/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ltci15ar
cwd: /tmp/pip-install-nvgwm6ep/pyperclip/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'bdist_wheel'

ERROR: Failed building wheel for pyperclip
Running setup.py clean for pyperclip
Building wheel for pyrect (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/david/whatsapp/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nvgwm6ep/pyrect/setup.py'"'"'; file='"'"'/tmp/pip-install-nvgwm6ep/pyrect/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-quq271gf
cwd: /tmp/pip-install-nvgwm6ep/pyrect/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'bdist_wheel'

ERROR: Failed building wheel for pyrect
Running setup.py clean for pyrect
Successfully built pymsgbox pyscreeze
Failed to build pyautogui wikipedia PyTweening mouseinfo pygetwindow python3-Xlib pyperclip pyrect
Installing collected packages: PyTweening, pyperclip, python3-Xlib, mouseinfo, pyrect, pygetwindow, pymsgbox, Pillow, pyscreeze, pyautogui, soupsieve, beautifulsoup4, certifi, urllib3, idna, chardet, requests, wikipedia, pywhatkit
Running setup.py install for PyTweening ... done
Running setup.py install for pyperclip ... done
Running setup.py install for python3-Xlib ... done
Running setup.py install for mouseinfo ... done
Running setup.py install for pyrect ... done
Running setup.py install for pygetwindow ... done
Running setup.py install for pyautogui ... done
Running setup.py install for wikipedia ... done
Successfully installed Pillow-8.2.0 PyTweening-1.0.3 beautifulsoup4-4.9.3 certifi-2021.5.30 chardet-4.0.0 idna-2.10 mouseinfo-0.1.3 pyautogui-0.9.52 pygetwindow-0.0.9 pymsgbox-1.0.9 pyperclip-1.8.2 pyrect-0.1.4 pyscreeze-0.1.27 python3-Xlib-0.15 pywhatkit-4.8 requests-2.25.1 soupsieve-2.2.1 urllib3-1.26.5 wikipedia-1.4.0
(whatsapp) ➜ whatsapp pip uninstall pywhatkit
Found existing installation: pywhatkit 4.8
Uninstalling pywhatkit-4.8:
Would remove:
/home/david/whatsapp/lib/python3.8/site-packages/pywhatkit-4.8.dist-info/*
/home/david/whatsapp/lib/python3.8/site-packages/pywhatkit/*
Proceed (y/n)? y
Successfully uninstalled pywhatkit-4.8
(whatsapp) ➜ whatsapp git clone https://github.com/Ankit404butfound/PyWhatKit
Cloning into 'PyWhatKit'...
remote: Enumerating objects: 742, done.
remote: Counting objects: 100% (277/277), done.
remote: Compressing objects: 100% (187/187), done.
remote: Total 742 (delta 162), reused 156 (delta 90), pack-reused 465
Receiving objects: 100% (742/742), 1.74 MiB | 2.68 MiB/s, done.
Resolving deltas: 100% (419/419), done.
`

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://pypi.org/project/pywhatkit/
  2. Click on 'the clipboard sign next to the pip command in the white box at the top'
  3. See error above

Expected behavior
A normal pip installation

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Browser: chrome

Additional context
Installation was successful following the installation guide here: https://github.com/Ankit404butfound/PyWhatKit/wiki
I'm working inside a venv

typo in readme

in readme file, command for information is written as:
pywatkit.info("Python",lines=3,speak=None)#Will give information about the topic

instead of:
pywhatkit.info("Python",lines=3,speak=None)#Will give information about the topic

i.e. one 'h' is missing from pywhatkit.

Error on Import line.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

pywhatkit.sendwhatmsg_to_group function is not working

bug issue

To Reproduce
Steps to reproduce the behavior:

  1. write a script pywhatkit.sendwhatmsg_to_group("groupid","message here", hours, minutes)
  2. wait for the script to execute and open WhatsApp web

Expected behavior
The python script opens the web browser correctly to the right group chat :)
the script does not type anything into the message textbox and submits nothing.

Desktop:

  • OS: Microsoft Windows 10
  • Browser [Chrome]

Please fix ASAP i got a project I want to work on ASAP i love your API its quick and efficient.

Can't install on Windows

I use PhyCharm going to the terminal. There I put your

pip install pywhatkit
and I use:

(venv) C:\Users\sch\PycharmProjects\WhatsAppMsg>python --version
Python 3.8.2

(venv) C:\Users\sch\PycharmProjects\WhatsAppMsg>pip --version
pip 19.0.3 from C:\Users\Schorsch\PycharmProjects\WhatsAppMsg\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip (python 3.8)

The output is than:

`(venv) C:\Users\sch\PycharmProjects\WhatsAppMsg>pip install pywhatkit
Collecting pywhatkit
Using cached https://files.pythonhosted.org/packages/2f/bf/6b9a6d676d526156ca7639ec61b1202d1192b4e4d806639aec507a66546e/pywhatkit-3.9-py3-none-any.whl
Collecting pyautogui (from pywhatkit)
Using cached https://files.pythonhosted.org/packages/40/0a/1373680148828d7ea3f0e432f06c08f51a33d72306719954d3ae379f5890/PyAutoGUI-0.9.52.tar.gz
Requirement already satisfied: requests in c:\users\sch\pycharmprojects\whatsappmsg\venv\lib\site-packages (from pywhatkit) (2.25.1)
Collecting Pillow (from pywhatkit)
Using cached https://files.pythonhosted.org/packages/73/59/3192bb3bc554ccbd678bdb32993928cb566dccf32f65dac65ac7e89eb311/Pillow-8.1.0.tar.gz
Requirement already satisfied: wikipedia in c:\users\sch\pycharmprojects\whatsappmsg\venv\lib\site-packages (from pywhatkit) (1.4.0)
Requirement already satisfied: beautifulsoup4 in c:\users\sch\pycharmprojects\whatsappmsg\venv\lib\site-packages (from pywhatkit) (4.9.3)
Collecting pymsgbox (from pyautogui->pywhatkit)
Collecting PyTweening>=1.0.1 (from pyautogui->pywhatkit)
Using cached https://files.pythonhosted.org/packages/b9/f8/c32a58d6e4dff8aa5c27e907194d69f3b57e525c2e4af96f39c6e9c854d2/PyTweening-1.0.3.zip
Collecting pyscreeze>=0.1.21 (from pyautogui->pywhatkit)
Using cached https://files.pythonhosted.org/packages/b7/7d/a0e85da28a96e2ff2f39e682ff84eb92501b564883fde87d92aee29966a2/PyScreeze-0.1.26.tar.gz
Collecting pygetwindow>=0.0.5 (from pyautogui->pywhatkit)
Using cached https://files.pythonhosted.org/packages/e1/70/c7a4f46dbf06048c6d57d9489b8e0f9c4c3d36b7479f03c5ca97eaa2541d/PyGetWindow-0.0.9.tar.gz
Collecting mouseinfo (from pyautogui->pywhatkit)
Using cached https://files.pythonhosted.org/packages/28/fa/b2ba8229b9381e8f6381c1dcae6f4159a7f72349e414ed19cfbbd1817173/MouseInfo-0.1.3.tar.gz
Requirement already satisfied: certifi>=2017.4.17 in c:\users\sch\pycharmprojects\whatsappmsg\venv\lib\site-packages (from requests->pywhatkit) (2020.12.5)
Requirement already satisfied: chardet<5,>=3.0.2 in c:\users\sch\pycharmprojects\whatsappmsg\venv\lib\site-packages (from requests->pywhatkit) (4.0.0)
Requirement already satisfied: idna<3,>=2.5 in c:\users\sch\pycharmprojects\whatsappmsg\venv\lib\site-packages (from requests->pywhatkit) (2.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\sch\pycharmprojects\whatsappmsg\venv\lib\site-packages (from requests->pywhatkit) (1.26.2)
Requirement already satisfied: soupsieve>1.2; python_version >= "3.0" in c:\users\sch\pycharmprojects\whatsappmsg\venv\lib\site-packages (from beautifulsoup4->pywhatkit) (2.1)
Collecting pyrect (from pygetwindow>=0.0.5->pyautogui->pywhatkit)
Using cached https://files.pythonhosted.org/packages/2f/68/bd7bf96fc44217e769f27912e6c9bb3e9987cba286054af6120448ce8212/PyRect-0.1.4.tar.gz
Collecting pyperclip (from mouseinfo->pyautogui->pywhatkit)
Using cached https://files.pythonhosted.org/packages/6f/4c/0b1d507ad7e8bc31d690d04b4f475e74c2002d060f7994ce8c09612df707/pyperclip-1.8.1.tar.gz
Installing collected packages: pymsgbox, PyTweening, Pillow, pyscreeze, pyrect, pygetwindow, pyperclip, mouseinfo, pyautogui, pywhatkit
Running setup.py install for PyTweening ... done
Running setup.py install for Pillow ... error
Complete output from command C:\Users\sch\PycharmProjects\WhatsAppMsg\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\sch\AppData\Local\Temp\p
ip-install-t7cjrtb6\Pillow\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\User
s\sch\AppData\Local\Temp\pip-record-rts0lbgx\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\sch\PycharmProjects\WhatsAppMsg\venv\include
site\python3.8\Pillow:
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\PIL
copying src\PIL\BdfFontFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\BlpImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\BmpImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\BufrStubImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\ContainerIO.py -> build\lib.win32-3.8\PIL
copying src\PIL\CurImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\DcxImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\DdsImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\EpsImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\ExifTags.py -> build\lib.win32-3.8\PIL
copying src\PIL\features.py -> build\lib.win32-3.8\PIL
copying src\PIL\FitsStubImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\FliImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\FontFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\FpxImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\FtexImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\GbrImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\GdImageFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\GifImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\GimpGradientFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\GimpPaletteFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\GribStubImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\Hdf5StubImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\IcnsImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\IcoImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\Image.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageChops.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageCms.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageColor.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageDraw.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageDraw2.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageEnhance.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageFilter.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageFont.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageGrab.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageMath.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageMode.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageMorph.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageOps.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImagePalette.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImagePath.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageQt.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageSequence.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageShow.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageStat.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageTk.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageTransform.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImageWin.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\ImtImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\IptcImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\Jpeg2KImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\JpegImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\JpegPresets.py -> build\lib.win32-3.8\PIL
copying src\PIL\McIdasImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\MicImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\MpegImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\MpoImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\MspImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PaletteFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\PalmImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PcdImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PcfFontFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\PcxImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PdfImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PdfParser.py -> build\lib.win32-3.8\PIL
copying src\PIL\PixarImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PngImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PpmImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PsdImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\PSDraw.py -> build\lib.win32-3.8\PIL
copying src\PIL\PyAccess.py -> build\lib.win32-3.8\PIL
copying src\PIL\SgiImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\SpiderImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\SunImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\TarIO.py -> build\lib.win32-3.8\PIL
copying src\PIL\TgaImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\TiffImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\TiffTags.py -> build\lib.win32-3.8\PIL
copying src\PIL\WalImageFile.py -> build\lib.win32-3.8\PIL
copying src\PIL\WebPImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\WmfImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\XbmImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\XpmImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL\XVThumbImagePlugin.py -> build\lib.win32-3.8\PIL
copying src\PIL_binary.py -> build\lib.win32-3.8\PIL
copying src\PIL_tkinter_finder.py -> build\lib.win32-3.8\PIL
copying src\PIL_util.py -> build\lib.win32-3.8\PIL
copying src\PIL_version.py -> build\lib.win32-3.8\PIL
copying src\PIL_init_.py -> build\lib.win32-3.8\PIL
copying src\PIL_main_.py -> build\lib.win32-3.8\PIL
running egg_info
writing src\Pillow.egg-info\PKG-INFO
writing dependency_links to src\Pillow.egg-info\dependency_links.txt
writing top-level names to src\Pillow.egg-info\top_level.txt
reading manifest file 'src\Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '.c'
warning: no files found matching '
.h'
warning: no files found matching '.sh'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files matching '.git
' found anywhere in distribution
warning: no previously-included files matching '.pyc' found anywhere in distribution
warning: no previously-included files matching '
.so' found anywhere in distribution
no previously-included directories found matching '.ci'
writing manifest file 'src\Pillow.egg-info\SOURCES.txt'
running build_ext

The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
   https://pillow.readthedocs.io/en/latest/installation.html

Traceback (most recent call last):
  File "C:\Users\sch\AppData\Local\Temp\pip-install-t7cjrtb6\Pillow\setup.py", line 865, in <module>
    setup(
  File "C:\Users\sch\PycharmProjects\WhatsAppMsg\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\__init__.py", line 145, in setup
  File "C:\Programme (USB)\Python\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Programme (USB)\Python\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Programme (USB)\Python\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\sch\PycharmProjects\WhatsAppMsg\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\command\install.py", line 61, in run
  File "C:\Programme (USB)\Python\lib\distutils\command\install.py", line 545, in run
    self.run_command('build')
  File "C:\Programme (USB)\Python\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Programme (USB)\Python\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Programme (USB)\Python\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "C:\Programme (USB)\Python\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Programme (USB)\Python\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\sch\PycharmProjects\WhatsAppMsg\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\command\build_ext.py", line 78, in run
  File "C:\Programme (USB)\Python\lib\distutils\command\build_ext.py", line 340, in run
    self.build_extensions()
  File "C:\Users\sch\AppData\Local\Temp\pip-install-t7cjrtb6\Pillow\setup.py", line 702, in build_extensions
    raise RequiredDependencyException(f)
__main__.RequiredDependencyException: zlib

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\sch\AppData\Local\Temp\pip-install-t7cjrtb6\Pillow\setup.py", line 922, in <module>
    raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:

The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
   https://pillow.readthedocs.io/en/latest/installation.html



----------------------------------------

Command "C:\Users\sch\PycharmProjects\WhatsAppMsg\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\sch\AppData\Local\Temp\pip-install-t7cjrtb6\Pil
low\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\sch\AppData\Local
\Temp\pip-record-rts0lbgx\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\sch\PycharmProjects\WhatsAppMsg\venv\include\site\python3.8\Pillow" f
ailed with error code 1 in C:\Users\sch\AppData\Local\Temp\pip-install-t7cjrtb6\Pillow\

`

module 'os' has no attribute 'startfile'

Operating system : Android 8.1.0
Environment : Termux

>>> text = "Hello world"
>>> pywhatkit.text_to_handwriting(text,rgb=[0,0,0])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/pywhatkit/chr_to_handwriting.py", line 9, in text_to_handwriting
    os.startfile(save_to)
AttributeError: module 'os' has no attribute 'startfile'

Not able to send message using sendwhatmsg function

Describe the bug
Not able to send message using sendwhatmsg function.
It is just copying the message in the text field of recipient but it is not sent automatically.

Expected behavior
it should send the message but message is just copied to the text field and not sent.

Desktop (please complete the following information):

  • OS: [Win 10]
  • Browser [ chrome]

unable to locate element in python selenium script

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="frm_text_username_#1id"]"}

unable to locate the id with my python selenium code

sendwhatmsg_to_group close tab too fast

When using sendwhatmsg_to_group and setting the tab to close after send, the message appears on in the web.whatsapp page, but never sends to the phone. When tabs are not closed everything works fine. There is an extra dialogue popping up in windows but it's too fast for me to catch before the tab closes.

`pysend.sendwhatmsg_to_group(gId, message, hourtosnd, mintosnd, 25, True, False)

`will send the message and leave tabs open.

`pysend.sendwhatmsg_to_group(gId, message, hourtosnd, mintosnd, 25, True, True) 

`closes the tab after writing the message but before it is sent from the phone.

I'm using:
Windows
Google Chrome - Version 91.0.4472.164 (Official Build) (64-bit)
Python 3.8.5

PyWhatKit creating issue with Tkinter

Describe the bug
I am making a virtual assistant and using PyWhatKit for playing youtube videos. I am also usinng Tkinter for GUI interaction with my assistant. When I import my GUI and PyWhatKit modules, the the GUI window reduces in size (something like 30% reduction in total size). I have checker multiple times by commenting out each moude one by one and its 'import pywhatkit' which is causing problem. I am also using threading to run GUI and local server.
My GUI is in server. When server is opened seperatly and the client is connected after wards there is no issue, but when trying to open two scripts (GUI-server and main assistant script) by importing them togeather in third script, the problem presents itself.

To Reproduce
I am unable to reproduce it in simple way.

This is expected outcome----
Screenshot (4)

This is what happens after PyWhatKit imports----
Screenshot (5)

Desktop (please complete the following information):

  • OS: [windows10]
  • Browser [chrome]
  • Version [88.0.4324.150]

Not able to get the bot working in raspberry Pi

I am running the raspberry pi as headless and I am controlling it via SSH, I installed all the modules correctly. but when I tried to run it the following error showed, The error is saying that I should have a Display in order to send a message. But I have set up my Pi as a server for bots.

  File "bot.py", line 1, in <module>
    import pywhatkit as kit
  File "/usr/local/lib/python3.7/dist-packages/pywhatkit/__init__.py", line 6, in <module>
    from pywhatkit.main import print_sleep_time, check_window, sendwhatmsg, sendwhatmsg_to_group, info, playonyt, search, close_tab, sendwhatmsg_instantly
  File "/usr/local/lib/python3.7/dist-packages/pywhatkit/main.py", line 3, in <module>
    import pyautogui as pg
  File "/usr/local/lib/python3.7/dist-packages/pyautogui/__init__.py", line 241, in <module>
    import mouseinfo
  File "/usr/local/lib/python3.7/dist-packages/mouseinfo/__init__.py", line 223, in <module>
    _display = Display(os.environ['DISPLAY'])
  File "/usr/lib/python3.7/os.py", line 678, in __getitem__
    raise KeyError(key) from None
KeyError: 'DISPLAY'

using existing opened WhatsApp web tab

I'm always frustrated when using the "sendwhatmsg" function in a loop, it opens a new tab every time.

Can we have it use the existing tab?

NB: I'm using pg.press("enter") to send the message, otherwise, it just copy-pastes in the text field.

Send image using sendwhats_image function for Mac

I made the code below and added it in sendwhats_image function. And it works on mac.

The code:

if system().lower() == "darwin":
         width, height = pg.size()
         pg.click(width / 2, height / 2)
         os.system(f"osascript -e 'set the clipboard to (read (POSIX file \"{img_path}\") as JPEG picture)'")
         time.sleep(wait_time)
         pg.hotkey("command", "v")
         time.sleep(3)
         pg.press('enter') 

My environment:
[OS: MacOs Big Sur 11.4]
[Browser: Google Chrome 91.0.4472.114]
[IDE: PyCharm CE 2021.1.3]

I leave my contribution for discussion. Thank you very much!

Unable to send several message to several number at the same time.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

AttributeError: module 'pyautogui' has no attribute 'getWindowsWithTitle'

Hello!

First of all, thanks for the library.

ISSUE: While using it, I encountered an issue trying to send a message into a group chat. The output is "AttributeError: module 'pyautogui' has no attribute 'getWindowsWithTitle'".

However, sending personal messages to particular users works.

I am trying to send a group message on Chrome, Linux (Pop!_OS)

Unable to import pywhatkit in Termux

  • Python: 3.9.0
  • Vncserver : tigervnc 1.10.1
Python 3.9.0 (default, Oct  8 2020, 15:54:02)
[Clang 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 98c855489 on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywhatkit
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/Xlib/support/unix_connect.py", line 76, in get_socket
    s.connect('/tmp/.X11-unix/X%d' % dno)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/pywhatkit/__init__.py", line 4, in <module>
    from pywhatkit.mainfunctions import sendwhatmsg_to_group, watch_tutorial_in_English, watch_tutorial_in_Hindi, developer_contact, showHistory, shutdown, cancelShutdown, prnt_sleeptm, check_window, sendwhatmsg, info, playonyt, image_to_ascii_art, search
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/pywhatkit/mainfunctions.py", line 3, in <module>
    import pyautogui as pg
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/pyautogui/__init__.py", line 241, in <module>
    import mouseinfo
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/mouseinfo/__init__.py", line 223, in <module>
    _display = Display(os.environ['DISPLAY'])
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/Xlib/display.py", line 80, in __init__
    self.display = _BaseDisplay(display)
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/Xlib/display.py", line 62, in __init__
    display.Display.__init__(*(self, ) + args, **keys)
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/Xlib/protocol/display.py", line 58, in __init__
    self.socket = connect.get_socket(name, host, displayno)
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/Xlib/support/connect.py", line 76, in get_socket
    return mod.get_socket(dname, host, dno)
  File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/Xlib/support/unix_connect.py", line 78, in get_socket
    raise error.DisplayConnectionError(dname, str(val))
Xlib.error.DisplayConnectionError: Can't connect to display ":4": [Errno 2] No such file or directory```

Pip Install IOError: Trying to get README from a hardcoded Windows path

Hi there, I noticed that the package pip installer setup is trying to perform some ODD/weird behavior. It's receiving RC with value 1 because for some reason try to get README file using a hardcoded windows path. Below the traceback

     cwd: /private/tmp/pip-install-9YjMmR/pywhatkit/
Complete output (7 lines):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/tmp/pip-install-9YjMmR/pywhatkit/setup.py", line 29, in <module>
    long_description=readme(),
  File "/private/tmp/pip-install-9YjMmR/pywhatkit/setup.py", line 5, in readme
    with open(r'C:\Users\pc\Desktop\pywhatkit\README.txt') as f:
IOError: [Errno 2] No such file or directory: 'C:\\Users\\pc\\Desktop\\pywhatkit\\README.txt'

with open(r'C:\Users\pc\Desktop\pywhatkit\README.txt') as f:

OSError: [WinError 87] The parameter is incorrect

OSError Traceback (most recent call last)
in
----> 1 pywhatkit.sendwhatmsg_with_selenium("+917488*****,"first msg by py",9,13)

C:\ANACNDA\lib\site-packages\pywhatkit_init_.py in sendwhatmsg_with_selenium(phone_no, message, time_hour, time_min, print_messages)
188 if headless_mode:
189 options.add_argument("--headless")
--> 190 driver = webdriver.Chrome(path,options=options)
191 url = ('https://web.whatsapp.com/send?phone='+phone_no)
192 driver.get(url)

C:\ANACNDA\lib\site-packages\selenium\webdriver\chrome\webdriver.py in init(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, keep_alive)
71 service_args=service_args,
72 log_path=service_log_path)
---> 73 self.service.start()
74
75 try:

C:\ANACNDA\lib\site-packages\selenium\webdriver\common\service.py in start(self)
74 stdout=self.log_file,
75 stderr=self.log_file,
---> 76 stdin=PIPE)
77 except TypeError:
78 raise

C:\ANACNDA\lib\subprocess.py in init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
798 c2pread, c2pwrite,
799 errread, errwrite,
--> 800 restore_signals, start_new_session)
801 except:
802 # Cleanup if the child failed starting.

C:\ANACNDA\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
1205 env,
1206 os.fspath(cwd) if cwd is not None else None,
-> 1207 startupinfo)
1208 finally:
1209 # Child is launched. Close the parent's copy of those pipe

OSError: [WinError 87] The parameter is incorrect

send whatsapp message to group

Hi Ankit, there is a option to send whatsapp message to groups by using pywhatkit.sendwhatmsg_to_group. But, I am not sure how to use it and i tried putting group names in it. But, it didn't succeed. can anyone help me how to send whatsapp message to group using pywhatkit.

Image to text (OCR feature)

OCR ( Optical Character Recognition ) in pywhatkit

PyWhatKit is great because of its ability to simple every python tasks. I would like to add a feature that converts hand written texts to machine readable texts (OCR)

Basically a user can provide any image and pywhatkit would extract all the texts out of the image. I thought this might be a great feature to have.

We could use any python modules that supports OCR, but the one I like most is pytesseract as its very accurate and uses google's OCR engine.

feature not working

whatsapp messages not able to deliver automatically in other browsers other then chrome

ytplay also dosnt able to play videos automatically in other browsers other then chrome

Tried to send message but the web is going to be opned in 24 hours!

Hi,
I tried to use your package in my code to send a whatsapp message but when I run the server local and try my request to post man which will call his line from your package
pywhatkit.sendwhatmsg("+201001234567",report.content,datetime.datetime.now().hour, datetime.datetime.now().minute)

it gives me this in the console

image

Am I really going to wait for 24 hours for this to test?!
I read the code and I saw that you set the left time with 86400 at some point, but I am not sure if this configurable or not
Could you please let me know if I am using this correctly or if there is something I am missing here?

Not sending the Message

Describe the bug
It opens WhatsApp and keeps the message in the proper location, but fails to send.

To Reproduce
I have Windows 10
Python 3.9
PyCharm 2021.1
Installed pywhatkit 5.0 from byCharm (File, setting, Python Interpreter, + install "pywhatkit".
tried different combinations of codes

import pywhatkit as kit

kit.sendwhats_image("+968#######", r"C:\Users\saifr\Dropbox\00 TEMP\b.jpg","It was very dilicus",)

kit.sendwhatmsg_instantly("+968#######", "Salam Ibrahim testing auto sending whatsApp")

kit.sendwhatmsg("+968#######", "Salam Ibrahim testing auto sending whatsApp",16,20,40,True,)

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [Windows 10]
  • Browser [chrome]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

shutdown is not recognized as a external or internal command

whenever I try to do --
pywhatkit.shutdown(time=10)#any time
I get the error -- shutdown is not recognized as a external or internal command

Anyone with the same error?

Can anyone help me with this how to fix it, is the problem with the module or my computer?
I am using windows 7 32 bit, python I am using - 3.8.6

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element

Hi, I am getting an error in pywhatkit.sendwhatmsg_with_selenium. Please help:
Traceback (most recent call last):
File "C:\Users\INTEL\Videos\Python\whatsapp2.py", line 6, in
pywhatkit.sendwhatmsg_with_selenium("+91**********","This is a message", 20,7)
File "C:\Python 32\lib\site-packages\pywhatkit_init_.py", line 194, in sendwhatmsg_with_selenium
msg_box = driver.find_element_by_xpath('//div[@contenteditable="true"][@Data-TAB="1"]')
File "C:\Python 32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "C:\Python 32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element
'value': value})['value']
File "C:\Python 32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Python 32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@contenteditable="true"][@Data-TAB="1"]"}
(Session info: headless chrome=84.0.4147.135)

Also I am getting one more error:
Traceback (most recent call last):
File "C:\Users\INTEL\Videos\Python\whatsapp2.py", line 6, in
pywhatkit.sendwhatmsg_with_selenium("+91**********","This is a message", 23,42)
File "C:\Python 32\lib\site-packages\pywhatkit_init_.py", line 190, in sendwhatmsg_with_selenium
driver = webdriver.Chrome(path,options=options)
File "C:\Python 32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 81, in init
desired_capabilities=desired_capabilities)
File "C:\Python 32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "C:\Python 32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Python 32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Python 32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: unable to discover open pages

Pywhatkit.playonyt - this site cannot be reached

windows10
Python 3.9.0

Hi,
I urgently need help. I’m trying to use the pywhatkit library and playonyt function in the program to play a song on youtube in a new tab. Unfortunately I get the error “This site cannot be reached. Please check www.youtube.com% 3E% 3C for an error.” and url looks like “https://www.youtube.com%3E%3C/form%3E%3Ca%20href=”
Yesterday I fired up the code and it worked normally, it wasn’t just looking for some songs and most of it turned on. Nothing changing today doesn’t work for me.
Please help

playonyt not working: This site can’t be reached

Hi! I am building an Alexa-like AI that I will use for personal use. I was working on the "Play Song" function using Pywhatkit's "playinyt" feature but whenever it opens youtube on my browser to play the video it says: This site can’t be reached (Check if there is a typo in www.youtube.com%3E%3C.) I don't know how to fix, so i could really use the help. this is my code for it:

`
def run_cherryAI():
command = take_command()
print(command)
if 'play' in command:
song = command.replace('play', '')
talk('playing'+ song)
pywhatkit.playonyt(song)

run_cherryAI() `

Output as pdf or word

The image size does not allow all sentences to fit in single image. It would be great of we could get pdf output.

Finding browser probleme

I used the example as shown on official page, and I got error about the browser

here is the output error:

File "C:\Users......\Python\Python39\lib\site-packages\pywhatkit\main.py", line 56, in sendwhatmsg
if browser.lower() not in ["chrome", "firefox", "brave", "opera"]:
AttributeError: 'NoneType' object has no attribute 'lower'

the solution for it is that I went to the main.py and in def sendwhatmsg I changed the value given to the browser parameter from 'None' to 'firefox' and it worked fine

A little meddling on the sendwhatmsg() in the CountryCodeExceptionErr

This maybe not a big change but I think it may be helpful for a lot of people like me. I am Maram Shrijan and I'm 14 years old. I would like to request a change in the sendwhatmsg function particularly the CountryCodeExeption.
First of all, the CountryCodeExeption is raised whenever there is no "+" in the string. This is going to be a problem for us who are using excel files to store phone numbers because Excel assumes it as a number.
After some research I found out that this function is using the URL to navigate to the particular number to send the WhatsApp Web message. The URL not only accepts "+" but also '(underscore)' as some formatting.
For example:
This is what we must format our format our phone numbers currently : "+60**********"
Here is what the URL also accepts : "60_***********"
So therefore here's what I propose for the CountryCodeExeption:
if "+" not in phone_no and "_" not in phone_no: raise CountryCodeException("Country code missing from phone_no") timehr = time_hour

original:
if "+" not in phone_no : raise CountryCodeException("Country code missing from phone_no") timehr = time_hour

This way, people who use excel to store phone numbers are not going to have that much of a problem.

Yes, I did edit the code I downloaded. I hope the fix could come soon.
BTW That little delay at the back is really useful

Error sending an instant message with 'tab_close' param.

Calling pywhatkit.sendwhatmsg_instantly() with tab_close argument results in an error.

Error Message
elif browser.lower() not in ["chrome", "firefox", "brave", "opera"]: AttributeError: 'bool' object has no attribute 'lower'

Steps to reproduce the behavior:

  1. import pywhatkit
  2. pywhatkit.sendwhatmsg_instantly("+9*****", "Hello", 10, True)

Expected behavior
A message should be delivered to the recipient and after the message is sent the tab should close.

  • OS: Windows 10, version - 21H1
  • Browser: Firefox 89.0.2 (64-bit)
  • python: Python 3.7.4
  • pip: pip 20.2

Can't work if time is less than one minute.

In sendwhatmsg function if time is less than one minute.

File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\site-packages\pywhatkit_init_.py", line 93, in sendwhatmsg
raise CallTimeException("Call time must be greater than one minutea as web.whatsapp.com takes some time to load")
pywhatkit.CallTimeException: Call time must be greater than one minutea as web.whatsapp.com takes some time to load

[Least Priority] Change the title PNG on GitHub page

I know it's not that important, but I think we should work on appearance too. That title PNG is not visible as it matches with the background black color.

solutions:

  1. Just change to a different color title
  2. Add a white padding around the current title image so it would work for both dark and light themes

By the way thanks for the awesome library

send_file function not working

FYA please.

pywhatkit.send_file("+923125661253","/home/zain/Documents/employees.csv",20,50)
Traceback (most recent call last):
File "", line 1, in
File "/home/zain/.local/lib/python3.8/site-packages/pywhatkit/init.py", line 214, in send_file
chrpath = chrpath.strip()
UnboundLocalError: local variable 'chrpath' referenced before assignment

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.