botcity-framework-web-python icon indicating copy to clipboard operation
botcity-framework-web-python copied to clipboard

Add validation to check if the temp dir path exists in the browser options

Open joao-voltarelli opened this issue 8 months ago • 0 comments

Some improvements have been made in the latest framework versions regarding excluding the bot's temporary folder. Since the folder configuration in IE is different from other browsers, an error is thrown when trying to register atexit in start_browser().

I think a possible solution could be adding the _botcity_temp_dir property in the IE options, even if it is None, just to avoid this error of the property not existing. Something like:

def default_options(headless=False, download_folder_path=None, user_data_dir=None,
                    page_load_strategy="normal") -> Options:
    """Retrieve the default options for this browser curated by BotCity.

    Returns:
        Options: The Internet Explorer options.
    """
    ie_options = Options()
    ie_options.add_argument("-embedding")
    ie_options.add_argument("-extoff")
    ie_options.add_argument("-k")
    ie_options._botcity_temp_dir = None //
    return ie_options

Reference: https://community.botcity.dev/t/modo-internet-explorer-issue/729

joao-voltarelli avatar Mar 31 '25 13:03 joao-voltarelli