コード例 #1
0
ファイル: record.py プロジェクト: hydroflux/abstractor-ws
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.'
コード例 #2
0
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.')
コード例 #3
0
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.')
コード例 #4
0
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)
コード例 #5
0
def get_result_type(result):
    return get_element_text(get_direct_children(result)[2])
コード例 #6
0
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
コード例 #7
0
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])