src/bto_sbf_webscraper/scraper.py
def process_block(driver, link):
    """Return the block details and unit details of the block that needs to be scraped

    Args:
        driver (webdriver): Selenium Webdriver
        link (str): Javascript code that needs to be executed to enter the page

    Returns:
        list (dict): Returns list of dictionaries containing details of the block and units
    """
    success = False
    while not success:
        try:
            initial_dict = {}
            driver.execute_script(link)
            sleep(5)
            initial_dict["Town"] = get_value_by_id(driver, "Town")
            initial_dict["Flat"] = get_value_by_id(driver, "Flat")
            unit_details = get_unit_details(driver)

            if unit_details:
                block_details = get_block_details(driver)
                final_data = [
                    {**initial_dict, **block_details, **x} for x in unit_details
                ]
                success = True
                return final_data
        except Exception:
            sleep(5)
            pass
Return the block details and unit details of the block that needs to be scraped

    Args:
        driver (webdriver): Selenium Webdriver
        link (str): Javascript code that needs to be executed to enter the page

    Returns:
        list (dict): Returns list of dictionaries containing details of the block and units
    
Return the block details and unit details of the block that needs to be scraped
Return the block details and unit details of the block that needs to be scraped
def process_block(driver, link):
    success = False
    while not success:
        try:
            initial_dict = {}
            driver.execute_script(link)
            sleep(5)
            initial_dict["Town"] = get_value_by_id(driver, "Town")
            initial_dict["Flat"] = get_value_by_id(driver, "Flat")
            unit_details = get_unit_details(driver)
            if unit_details:
                block_details = get_block_details(driver)
                final_data = [
                    {**initial_dict, **block_details, **x} for x in unit_details
                ]
                success = True
                return final_data
        except Exception:
            sleep(5)
            pass
def process_block ( driver , link ) : success = False while not success : try : initial_dict = { } driver . execute_script ( link ) sleep ( 5 ) initial_dict [ "Town" ] = get_value_by_id ( driver , "Town" ) initial_dict [ "Flat" ] = get_value_by_id ( driver , "Flat" ) unit_details = get_unit_details ( driver ) if unit_details : block_details = get_block_details ( driver ) final_data = [ { ** initial_dict , ** block_details , ** x } for x in unit_details ] success = True return final_data except Exception : sleep ( 5 ) pass
Return the block details and unit details of the block that needs to be scraped
Return the block details and unit details of the block that needs to be scraped
"""Return the block details and unit details of the block that needs to be scraped

    Args:
        driver (webdriver): Selenium Webdriver
        link (str): Javascript code that needs to be executed to enter the page

    Returns:
        list (dict): Returns list of dictionaries containing details of the block and units
    """
list (dict): Returns list of dictionaries containing details of the block and units
list ( dict ) : Returns list of dictionaries containing details of the block and units
driver
None
link
Javascript code that needs to be executed to enter the page
Javascript code that needs to be executed to enter the page