Hey, good morning. I created this code in PyCharm using Windows 10 64bit, however when it gets to the end shown in the video, it doesn’t click on the image with the name GTA V - LINKS LIST. Do you have any solution for this problem?
Here is the code:
from botcity.core import DesktopBot
import chardet
import codecs
import pyperclip
class Bot(DesktopBot):
def action(self, execution=None):
if not self.find( “ClicaNoIconeDoNavegador”, matching=0.97, waiting_time=10000):
self.not_found(“ClicaNoIconeDoNavegador”)
self.click()
if not self.find( “SinoVermelho”, matching=0.97, waiting_time=10000):
self.not_found(“SinoVermelho”)
self.click()
if not self.find( “VoceVendeuGTA5”, matching=0.97, waiting_time=10000):
self.not_found(“VoceVendeuGTA5”)
self.click()
if not self.find( “VerMensagem”, matching=0.97, waiting_time=10000):
self.not_found(“VerMensagem”)
self.click()
if not self.find( “CampoDeMensagemSelecionado”, matching=0.97, waiting_time=10000):
self.not_found(“CampoDeMensagemSelecionado”)
self.click_relative(125, 9)
with open(f’C:\Users\Rafael\Desktop\MercadoLivre\ArquivosDeTexto\mensagens.txt’, ‘rb’) as f:
codificacao = chardet.detect(f.read())[‘encoding’]
with codecs.open(‘C:\Users\Rafael\Desktop\MercadoLivre\ArquivosDeTexto\mensagens.txt’, ‘r’, encoding=codificacao) as f:
texto = f.read()
pyperclip.copy(texto)
self.paste()
if not self.find( “CliqueNoClip”, matching=0.97, waiting_time=10000):
self.not_found(“CliqueNoClip”)
self.click()
if not self.find( “ClicaNoCampoDeDiretorios”, matching=0.97, waiting_time=10000):
self.not_found(“ClicaNoCampoDeDiretorios”)
self.click_relative(436, 16)
self.paste('C:\\Users\\Rafael\\Desktop\\MercadoLivre\\GTAV')
self.enter()
self.wait(2000)
if not self.find( "teste2", matching=0.97, waiting_time=10000):
self.not_found("teste2")
self.click()
self.wait(2000)
self.double_click()
@staticmethod
def not_found(label):
print(f"Element not found: {label}")
if name == ‘main’:
Bot.main()
I will send you a video of the program running.