![]() init(DesiredCapabilities.CHROME, "goog",įile "C:\Program Files\Python39\lib\site-packages\selenium-4.0.0b4-p圓.9.egg\selenium\webdriver\chromium\webdriver.py", line 93, in initįile "C:\Program Files\Python39\lib\site-packages\selenium-4.0.0b4-p圓.9.egg\selenium\webdriver\remote\webdriver.py", line 248, in init ![]() To saved contact use method find_by_username() to locate saved user,you can also use the same method to locate WhatsApp groups, The parameter can be either be įile "C:\Program Files\Python39\lib\site-packages\alright-1.1-p圓.9.egg\alright_ init_.py", line 27, in initįile "C:\Program Files\Python39\lib\site-packages\selenium-4.0.0b4-p圓.9.egg\selenium\webdriver\chrome\webdriver.py", line 69, in init The first step before sending anything to the user is first to locate the user and then you can start sending the informations thats where the main difference lies btn saved and unsaved contacts. When you're running your program made with alright, you can only have one controlled browser window at a time, If you run while another window is live it raise an error so make sure to close the controlled window before running another one Unsaved contact vs saved contactsĪlright allows you to send the messages and media to both unsaved contacts as explained earlier but there is a tiny distinction on how you do that, you will observe this clearly as use the package. Now after that we're now ready to automating and controlling whatsappp web using alright What you can do with alright? Windows users follow this guide to actually do that. Linuxįor linux to permanently add path to browser do this Įxport PATH= " $PATH:/home/kalebu/chrome-driver " Windows One more final step to set up is to add the selenium driver location to path so as it can be discovered by alright, which varies depending on the operating system you're using.įor instance lets say example the current location our driver is in /home/kalebu/chrome-driver (You can view full path to your driver by running pwd command), Here how you would do that. Here a guide to check the version of chrome you're using Adding selenium driver to path You need to make sure you download the chromedriver compatible with Chrome version you're using otherwise it won't work and also don't forget to extract the zip version of a driver So primarly I developed alright and tested on a Chrome browser and therefore it gonna require you to have Chrome and chromedriver other browser support coming soon. Underneath alright is Selenium which is one does all the automation work by directly controlling the browser, so you need to have a selenium driver on your machine for alright to work. You first need to clone or download the repo to your local directory and then move into the project directory as shown in the example and then run the below command We need to have alright installed on our machine to start using which can either be done directly from GitHub or using pip. You need to do a little bit of work to get alright to running, but don't worry I gotcha you, everything will work well if you just carefully follow through the documentation. So what I did is more of a refactoring of the implementation of that tool to be more of wrapper to easily allow people to run different scripts on top of it instead of just using as a tool I then thought of sharing the codebase to people who might struggled to do this as I did. ![]() Which is PyWhatsapp by shauryauppal, which was more of cli tool than a wrapper which suprisingly worked and it's approach allows you to dynamically send whatsapp message to unsaved contacts without rescanning QR-code everytime. I then went for WebWhatsapp-Wrapper, it has some good documentation and recent commits so I had hopes it gonna work but It didn't for me, and after having couples of errors I abandoned it to look for the next alternative. I then tried pywhatsapp which is based on yowsup and thus requiring you to do some registration with yowsup before using it of which after bit of googling I got scared of having my number blocked when I do that so I went for the next option So I tried pywhatkit, really cool one well crafted to be used by others but its implementations require you to open a new browser tap and scan QR code everytime you send a message no matter if its the same person, which was deal breaker for using it. I was looking for a way to control and automate WhatsApp web with Python, I came across some very nice libaries and wrappers implementations including Python wrapper for WhatsApp web made with selenium inspired by PyWhatsApp ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |