Identify an element in Seleniumchmore Drive if it does not appear to perform a function

Asked

Viewed 18 times

0

Well it makes use of the for to pull the spreadsheet the phone numbers of the whatapp web page and send the message but in some case the phone may not exist, generating an error.

I tried to do the for to mean the element with is_detected() but had no result.

Would Try use to treat error?

def enviar_contact(list_msg_excel): driver = webdriver. Chrome(r"C: Users Naga-tour Desktop Projects chromedriver.exe")

driver.get('https://web.whatsapp.com/')


print("Aperte o Enter para Continuar")
input()



for index, contato_excel in lista_msg_excel.iterrows():
    driver.get('https://web.whatsapp.com/send?phone=55'+ str(contato_excel[0]))
    time.sleep(10)


    msg_incial = "Ola, " + contato_excel[1] + mensagem 
    enviar_msg(msg_incial, driver)
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.