[英]How can extract this information from web whatsapp; using python and selenium
大家好我希望你们好。 我想使用 selenium 从 webwhatsapp 中提取这些数字
这是我的代码:
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
import os
dir_path = os.getcwd()
profile = os.path.join(dir_path, "profile", "wpp")
s=Service('chromedriver.exe')
op = webdriver.ChromeOptions()
op.add_experimental_option('excludeSwitches', ['enable-logging'])
op.add_argument(
r"user-data-dir={}".format(profile))
driver = webdriver.Chrome(service=s, options=op)
url='https://web.whatsapp.com'
driver.get(url)
numbers=driver.find_element(By.CLASS_NAME, "zzgSd _3e6xi").text
print(numbers)
但这不起作用。 请帮我!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.