def check_list_elements(general_information, title_options): for header, data in general_information: if get_element_text(header) in title_options: if get_element_text(header) in row_titles["document_image"]: return data if get_element_text(data) != "": return get_element_text(data) else: return not_applicable return 'No row title match found.'
def locate_results_statement(results_table, document): try: results_statement_present = EC.presence_of_element_located( (By.TAG_NAME, results_statement_tag)) WebDriverWait(results_table, timeout).until(results_statement_present) results_statement = results_table.find_element_by_tag_name( results_statement_tag) return get_element_text(results_statement) except TimeoutException: print(f'Browser timed out trying to locate results statement for ' f'{extrapolate_document_value(document)}, please review.')
def locate_results_page_information(browser, document): try: results_page_present = EC.presence_of_element_located( (By.ID, results_page_id)) WebDriverWait(browser, timeout).until(results_page_present) results_page = browser.find_element_by_id(results_page_id) return get_element_text(results_page) except TimeoutException: print( f'Browser timed out trying to locate results page information for ' f'{extrapolate_document_value(document)}, please review.')
def filter_search_results(result_list, result): if get_result_type(result) not in filter_list: search_result = get_element_text(get_result_number(result)) if search_result not in result_list: result_list.append(search_result)
def get_result_type(result): return get_element_text(get_direct_children(result)[2])
def verify_search_results(search_results, document): for result in search_results: result_number = get_result_number(result) if document_value(document) == get_element_text(result_number): get_document_description_link(result_number, document) document.number_results += 1
def get_row_data(abstract, row): row_data = row.find_elements_by_tag_name(abstract.county.tags["Row Data"]) return get_element_text(row_data[0]), get_element_text(row_data[1])