Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ability to send picture with caption #46

Merged
merged 1 commit into from
Mar 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion alright/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def send_attachment(self):
)
sendButton.click()

def send_picture(self, picture):
def send_picture(self, picture, message):
"""send_picture ()

Sends a picture to a target user
Expand All @@ -246,6 +246,16 @@ def send_picture(self, picture):
)
)
imgButton.send_keys(filename)
inp_xpath = '//*[@id="app"]/div[1]/div[1]/div[2]/div[2]/span/div[1]/span/div[1]/div/div[2]/div/div[1]/div[3]/div/div/div[2]/div/div[2]'
input_box = self.wait.until(
EC.presence_of_element_located(
(
By.XPATH,
inp_xpath
)
)
)
input_box.send_keys(message)
self.send_attachment()
print(f"Picture has been successfully sent to {self.mobile}")
except (NoSuchElementException, Exception) as bug:
Expand Down