diff --git a/main.py b/main.py index b06eec4..e30a29d 100644 --- a/main.py +++ b/main.py @@ -286,7 +286,9 @@ def _select_friends(self, target_count): if not friend_el.find("div", attrs={"role": "checkbox"}): idx += 1 continue - + # Sort friends by activity level (example heuristic) + friend_activity = get_friend_activity(friend_el) + friends.sort(key=lambda x: get_friend_activity(x), reverse=True) try: xpath = xpath_soup(friend_el) sel_el = self.driver.find_element(By.XPATH, xpath)