
Enviado em 26/03/2020 - 21:57h
Boa noite coelgas,selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//div[contains(@class, '2S1VP')]"} self.caixa_de_pesquisa = self.driver.find_element_by_xpath("//div[contains(@class, '2S1VP')]") import os
import time
import re
import requests
import json
from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot
from selenium import webdriver
class wppbot:
dir_path = os.getcwd()
def __init__(self, nome_bot):
print(self.dir_path)
self.bot = ChatBot(nome_bot)
#self.bot.set_trainer(ListTrainer)
self.trainer = ListTrainer(self.bot)
#self.trainer.train(self.conversas)
self.chrome = self.dir_path+'/chromedriver'
self.options = webdriver.ChromeOptions()
self.options.add_argument(r"user-data-dir="+self.dir_path+"/profile/wpp")
self.options.add_argument('--headless')
self.options.add_argument('--no-sandbox')
self.options.add_argument('--disable-dev-shm-usage')
self.driver = webdriver.Chrome(self.chrome, chrome_options=self.options)
def inicia(self,nome_contato):
self.driver.get('https://web.whatsapp.com/')
self.driver.implicitly_wait(20)
self.caixa_de_pesquisa = self.driver.find_element_by_xpath("//div[contains(@class, '2S1VP')]")
self.caixa_de_pesquisa.send_keys(nome_contato)
time.sleep(2)
print(nome_contato)
self.contato = self.driver.find_element_by_xpath('//span[@title = "{}"]'.format(nome_contato))
self.contato.click()
time.sleep(2)
Monitorando o Preço do Bitcoin ou sua Cripto Favorita em Tempo Real com um Widget Flutuante
IA Turbina o Desktop Linux enquanto distros renovam forças
Como extrair chaves TOTP 2FA a partir de QRCODE (Google Authenticator)
Como realizar um ataque de força bruta para desobrir senhas?
Como usar Gpaste no ambiente Cinnamon
Atualizando o Fedora 42 para 43
PERFIL CRIADO NO SAMBA AD DC NÃO LOGA NO WINDOWS 10 E 11 (2)
Estou tentando ser legalista, mas tá complicado! (0)
É normal não gostar de KDE? (17)
PERFIL CRIADO NO SAMBA AD DC NÃO LOGA NO WINDOWS 10 E 11 (1)









