Did whatsapp web changed the button path for the attachement?
I used this but nothing happened:
def attach_image(self):
if self.image_path and os.path.isfile(self.image_path):
print(f"Attaching image from {self.image_path}")
# Click the attachment button
attachment_button_path = '//div[@title="Attach"]'
attachment_button = self.driver_wait.until(
EC.element_to_be_clickable((By.XPATH, attachment_button_path))
)
attachment_button.click()
# Wait for the file input element and send the image path
image_button_path = '//input[@accept="image/*,video/mp4,video/3gpp,video/quicktime"]'
image_button = self.driver_wait.until(
EC.presence_of_element_located((By.XPATH, image_button_path))
)
image_button.send_keys(self.image_path)
# Give some time for the image to be attached
time.sleep(10)
else:
print(f"Image file not found: {self.image_path}")
did they change the button number or something?
New contributor
Ghazayel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.