可以批量筛选手机号是否注册了WhatsApp的有效代码

一段可以批量筛选手机号是否注册了WhatsApp的有效代码,经验证有效;现在开源出来,代码如下:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

#Initialize the webdriver for Firefox

driver = webdriver.Firefox()

#Open the WhatsApp Web interface

driver.get(“https://web.whatsapp.com/”)

#Wait for the user to scan the QR code and log in

input(“Press Enter after scanning the QR code and logging in…”)

#Open the file containing the phone numbers

with open(“phone.txt”, “r”) as f:
for line in f:

#Strip any whitespace from the line

line = line.strip()

#Navigate to the WhatsApp Web search page

driver.get(f"WhatsApp Web“)
time.sleep(10) # wait for the page to load

#Check if the phone number is registered on WhatsApp

if driver.find_elements_by_xpath(”//button[contains(text(), ‘Send message’)]“):
print(f”{line} - Registered on WhatsApp")
else:
print(f"{line} - Not registered on WhatsApp")

#Close the webdriver

driver.quit()

添加客服微信咨询:

添加微信公众号加入万人群组交流:

出海跨境王

我还没有学会写个人说明!

相关推荐

将 WhatsApp 聊天导入 Telegram怎么搞?详细步骤来了(由于WhatsApp最新的隐私政策和内容风控因素限制很多,许多WhatsApp用户正在寻找替代方案,而Telegram成为他们的最佳选择)

由于WhatsApp最新的隐私政策和内容风控因素限制很多,许多WhatsApp用户正在寻找替代方案,而Telegram成为他们的最佳选择。Telegram 是一款消息应用程序,可为私人消息提供端到端加密,还好Telegram提供了将 WhatsApp 聊天无缝传输到它的选项。