Tithibots / tithiwa

Automate Web WhatsApp with selenium in python.
MIT License
24 stars 22 forks source link

clear_all_chats method was added in Tithiwa class #83

Closed ghostrider22 closed 2 years ago

ghostrider22 commented 2 years ago

Capture Since whatsapp had two elements for menu with same class and Ids, I was forced to use full xpath instead of CSS selector for accessing the menu. Then using arrow keys the program navigates to "clear messages", and then uses ENTER key to clear chat. Sometimes chat takes some time to load, and program returned error "element not found", to avoid that I tried using implicit wait - self.browser.implicitly_wait(3), but for some reason I still recieved error so atlast I used sleep(0.5).

NavpreetDevpuri commented 2 years ago

We need to avoid using sleep() because we need to find an efficient way so that we don't need to wait longer. i.e use efficient one of something is done or something is not done

And we need to fix #84

Give it a try

ghostrider22 commented 2 years ago

Ok sir

ghostrider22 commented 2 years ago

Sir, I have removed time.sleep() and instead added try-except block inside a infinite while loop. The only way to break while loop is when the program successfully finds and clicks the desired element. I have tested the program and its working fine.

NavpreetDevpuri commented 2 years ago

We found new bug #89