carlogtt_python_library.amazon_internal.midway_selenium module
This module …
- class carlogtt_python_library.amazon_internal.midway_selenium.MidwaySeleniumDriver(driver: WebDriver | WebDriver | WebDriver | WebDriver, cookie_filepath: str = '')[source]
Bases:
objectFacilitates the creation and management of a Selenium WebDriver that is authenticated against the Midway authentication system. This class provides methods to obtain a WebDriver instance with Midway authentication cookies applied, allowing automated navigation of pages that require Midway authentication.
Use the get_selenium_driver class method to obtain an authenticated Selenium WebDriver instance, or instantiate this class with an existing WebDriver to apply Midway authentication.
- Parameters:
driver – An instance of Selenium WebDriver.
cookie_filepath – Optional; the filepath to the Midway authentication cookies file. If not provided, the class looks for the cookie file in the default location ~/.midway/cookie.
- classmethod get_selenium_driver(headless: bool = True, cookie_filepath: str = '') MidwaySeleniumDriver[source]
Get a Selenium driver instance.
- Returns:
a Selenium Chrome driver.