def map_party_information(rows, document): grantor = [] grantee = [] for row in rows: row_data = locate_elements_by_tag_name(row, row_data_tag_name, f'row data => {row.text}', document=document) # row_data = locate_row_data(row, document) access_party_details(row_data, grantor_text, grantor) access_party_details(row_data, grantee_text, grantee) return grantor, grantee
def get_document_content(browser, abstract, document): document_information = access_document_information(browser, abstract, document) document_table_data = locate_element_by_tag_name( document_information, abstract.county.tags["Document Table"], "document table data", False, document) table_rows = locate_elements_by_tag_name( document_table_data, abstract.county.tags["Table Rows"], "table rows", False, document) return table_rows
def get_document_link(abstract, result, document): result_actions_list = locate_element_by_class_name( result, abstract.county.classes["Result Actions"], "search results actions list", document=document) return locate_elements_by_tag_name(result_actions_list, abstract.county.tags["Result Actions"], "search actions", document=document)[1]
def open_result(browser, document): search_results = locate_element( browser, document.search_attributes["Results Table Id"], "search results", document=document) result_script = get_direct_link( locate_elements_by_tag_name(search_results, result_link_tag_name, "result link", True, document)[1]) javascript_script_execution(browser, result_script)
def access_iframe_by_tag(browser): iframes = locate_elements_by_tag_name(browser, 'iframe', 'iframes') if len(iframes) == 0: print( 'Browser unable to locate any iframes on the page, please review.') elif len(iframes) > 1: print('Browser has located multiple iframes on the page, ' 'please attempt to access using a different method.') else: return iframes[0]
def aggregate_document_table_information(browser, abstract, document): document_tables = locate_elements_by_tag_name( browser, abstract.county.tags["Document Tables"], "document tables", document=document) record_indexing_information(abstract, document_tables[2], document) record_grantor(abstract, document_tables[6], document) record_grantee(abstract, document_tables[7], document) record_related_documents(abstract, document_tables[8], document) record_legal(abstract, document_tables[10], document)
def get_document_content(browser, abstract, document): document_information = access_document_information(browser, abstract, document) document_table_body = locate_element_by_tag_name( document_information, abstract.county.tags["Body"], "document table body", False, document) table_rows = locate_elements_by_tag_name(document_table_body, abstract.county.tags["Rows"], "document table rows", False, document) return table_rows
def check_results(browser, document): search_results = locate_element( browser, document.search_attributes["Results Table Id"], "search results", document=document) if search_results is not None: first_result = locate_elements_by_tag_name(search_results, results_tag_name, "first result", document=document) volume = int(document.document_value()[0]) if volume in patent_range and volume * 10 == int(first_result[2].text): return True elif volume == int(first_result[2].text): return True
def get_search_result_rows(browser, document): search_results = locate_element_by_id(browser, results_table_id, "search results", document=document) result_rows = locate_elements_by_tag_name(search_results, result_row_tag_name, "search result rows", document=document) return result_rows[1:-1]
def access_first_row(abstract, document, results_table): all_results = locate_elements_by_tag_name(results_table, abstract.county.tags["Rows"], "search results", document=document) return all_results[0]
def check_result(browser, abstract, document, row): row_cells = locate_elements_by_tag_name(row, abstract.county.tags["Result Cell"], "result row cells", False, document) if verify_result(document, row_cells): document.number_results += 1 return True
def access_parties_rows(browser, document, field_type='parties'): parties_table = locate_element_by_id(browser, parties_id, field_type, document=document) return locate_elements_by_tag_name(parties_table, party_rows_tag_name, "document party rows", document=document)[1:]