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

Make scrape_all_contacts(), send_message_containing_url_to_their_own_chatroom() and send_message_containing_url_to_their_own_chatroom_to_all_contacts() #42

Open
NavpreetDevpuri opened this issue Oct 14, 2020 · 2 comments

Comments

@NavpreetDevpuri
Copy link
Member

NavpreetDevpuri commented Oct 14, 2020

Useful
scrape_all_contacts(): get a list of all contacts

Just for Fun: use scrape_all_contacts() and send_message_to_number() for following functions

def send_message_to_number(self, number, message):

send_message_containing_url_to_their_own_chatroom(number):
send_message_containing_url_to_their_own_chatroom_to_all_contacts()

@NavpreetDevpuri NavpreetDevpuri changed the title Make scrape_all_contacts(), send_message_containing_url_to_thier_own_chatroom() and send_message_containing_url_to_thier_own_chatroom_to_all_contacts() Make scrape_all_contacts(), send_message_containing_url_to_their_own_chatroom() and send_message_containing_url_to_their_own_chatroom_to_all_contacts() Oct 14, 2020
@NavpreetDevpuri NavpreetDevpuri removed the good first issue Good for newcomers label Oct 17, 2020
@NavpreetDevpuri
Copy link
Member Author

NavpreetDevpuri commented Oct 17, 2020

tithiwa/tithiwa/group.py

Lines 113 to 130 in 7cef0e1

def exit_from_all_groups(self):
self._wait_for_an_presence_of_element(SELECTORS.GROUPS.GROUP_NAME_IN_CHATS)
self._wait_for_an_element_to_be_clickable(SELECTORS.MAIN_SEARCH_BAR).click()
preactive = None
self.browser.switch_to.active_element.send_keys(Keys.ARROW_DOWN)
curractive = self.browser.switch_to.active_element
while curractive != preactive:
groupnameelement = None
try:
groupnameelement = curractive.find_element(By.CSS_SELECTOR, SELECTORS.GROUPS.GROUP_NAME_IN_CHATS)
except:
pass
if groupnameelement != None:
groupname = groupnameelement.get_attribute('innerText')
self._wait_for_group_to_open_then_exit(groupname)
preactive = curractive
curractive.send_keys(Keys.ARROW_DOWN)
curractive = self.browser.switch_to.active_element

That's how we can go through all chats
And do similar things to go through all contacts.

@NavpreetDevpuri
Copy link
Member Author

NavpreetDevpuri commented Oct 21, 2020

HINT: When we open contacts it sends requests containing mobile numbers.
ShareX_KxVxOnDYf0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant