Prepared to work specially with the dynamic data load in the 'Likes' dialog box
(old_data, dialog, logger)
| 2269 | |
| 2270 | |
| 2271 | def get_users_from_dialog(old_data, dialog, logger): |
| 2272 | """ |
| 2273 | Prepared to work specially with the dynamic data load in the 'Likes' |
| 2274 | dialog box |
| 2275 | """ |
| 2276 | |
| 2277 | try: |
| 2278 | user_blocks = dialog.find_elements(By.TAG_NAME, "a") |
| 2279 | loaded_users = [ |
| 2280 | extract_text_from_element(u) |
| 2281 | for u in user_blocks |
| 2282 | if extract_text_from_element(u) |
| 2283 | ] |
| 2284 | new_data = old_data + loaded_users |
| 2285 | new_data = remove_duplicates(new_data, True, None) |
| 2286 | |
| 2287 | return new_data |
| 2288 | |
| 2289 | except (NoSuchElementException, StaleElementReferenceException) as exc: |
| 2290 | # Catch stale elements if any |
| 2291 | logger.error( |
| 2292 | "Error occurred while retrieving data.\n\t{}".format( |
| 2293 | str(exc).encode("utf-8") |
| 2294 | ) |
| 2295 | ) |
| 2296 | |
| 2297 | return old_data |
| 2298 | |
| 2299 | |
| 2300 | def progress_tracker(current_value, highest_value, initial_time, logger): |
no test coverage detected