<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: markbusking</title>
    <description>The latest articles on DEV Community by markbusking (@markbusking).</description>
    <link>https://dev.to/markbusking</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4015346%2F3c28cfe5-b8c9-49ac-9de1-5913880eaed9.png</url>
      <title>DEV Community: markbusking</title>
      <link>https://dev.to/markbusking</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/markbusking"/>
    <language>en</language>
    <item>
      <title>How to Automate WhatsApp with Python in 2026 (No Selenium, No BS)</title>
      <dc:creator>markbusking</dc:creator>
      <pubDate>Sat, 04 Jul 2026 17:21:34 +0000</pubDate>
      <link>https://dev.to/markbusking/how-to-automate-whatsapp-with-python-in-2026-no-selenium-no-bs-1fb5</link>
      <guid>https://dev.to/markbusking/how-to-automate-whatsapp-with-python-in-2026-no-selenium-no-bs-1fb5</guid>
      <description>&lt;p&gt;How to Automate WhatsApp with Python in 2026&lt;/p&gt;

&lt;p&gt;Every WhatsApp automation tutorial still recommends &lt;code&gt;selenium&lt;/code&gt; with fragile XPath selectors that break every week. There's a better way.&lt;/p&gt;

&lt;p&gt;Why Playwright + &lt;code&gt;whatsplay&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;Playwright is faster, more reliable, and &lt;code&gt;whatsplay&lt;/code&gt; wraps the WhatsApp Web DOM with stable selectors (attribute-based instead of minified class names).&lt;/p&gt;

&lt;p&gt;What you'll build&lt;br&gt;
A bot that monitors a price and sends an alert to your WhatsApp group.&lt;/p&gt;

&lt;p&gt;Install&lt;br&gt;
pip install whatsplay playwright&lt;br&gt;
playwright install chromium&lt;/p&gt;

&lt;p&gt;Step 1: Connect to WhatsApp&lt;br&gt;
from whatsplay import Client&lt;/p&gt;

&lt;p&gt;client = Client()&lt;br&gt;
client.launch()&lt;br&gt;
client.wait_for_login()&lt;/p&gt;

&lt;p&gt;Step 2: Send a message&lt;br&gt;
chat = client.get_chat("Mi Grupo")&lt;br&gt;
chat.send_message("¡Hola! Esto es automático 🤖")&lt;/p&gt;

&lt;p&gt;Step 3: Monitor + alert (real use case)&lt;br&gt;
import httpx&lt;/p&gt;

&lt;p&gt;def check_price():&lt;br&gt;
    r = httpx.get("&lt;a href="https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&amp;amp;vs_currencies=usd%22" rel="noopener noreferrer"&gt;https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&amp;amp;vs_currencies=usd"&lt;/a&gt;)&lt;br&gt;
    return r.json()["bitcoin"]["usd"]&lt;/p&gt;

&lt;p&gt;@client.on_message()&lt;br&gt;
def handler(msg):&lt;br&gt;
    if msg.text and "precio" in msg.text.lower():&lt;br&gt;
        price = check_price()&lt;br&gt;
        chat.send_message(f"BTC está en ${price:,}")&lt;/p&gt;

&lt;p&gt;Why this approach wins&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Selectors don't break on WhatsApp updates&lt;/li&gt;
&lt;li&gt;Works with QR login, persistent sessions&lt;/li&gt;
&lt;li&gt;34 tests covering message parsing, timestamps, voice messages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Full docs: github.com/markbus-ai/whatsplay (&lt;a href="https://github.com/markbus-ai/whatsplay" rel="noopener noreferrer"&gt;https://github.com/markbus-ai/whatsplay&lt;/a&gt;)&lt;br&gt;
PyPI: pip install whatsplay&lt;/p&gt;

</description>
      <category>python</category>
      <category>whatsapp</category>
      <category>playwright</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
