Metadata-Version: 2.2
Name: browser_manager
Version: 1.0.5
Summary: The BrowserManager Library simplifies browser automation and management...
Author-email: Dux Tecnologia <contato@tpereira.com.br>
License: MIT License
        
        Copyright (c) 2024 Dux Tecnologia
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: homepage, https://duxtec.github.io/browser-manager/docs
Project-URL: repository, https://github.com/duxtec/browser-manager
Project-URL: documentation, https://duxtec.github.io/browser-manager/docs
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE

# BrowserManager Library

## Description

The **BrowserManager Library** simplifies browser automation and management by detecting installed browsers, selecting user profiles, and integrating with Selenium WebDriver for automated testing and tasks. The library abstracts the logic for locating installed browsers on the system, configuring user profiles, and managing drivers, with support for **Windows**, **Linux**, and **macOS**.

## Features

- **Automatic Detection of Installed Browsers**: Supports Chrome, Chromium, Firefox, Microsoft Edge, Safari, Opera, and Internet Explorer.
- **Profile Management**: Lists and selects user profiles for the browsers.
- **Selenium WebDriver Automation**: Easy integration with Selenium for browser automation.

## Installation

To install the library, run:

```bash
pip install browser_manager
```

## Usage Examples

### Example Usage with BrowserManager

Here's a example of how to use the library to automate a browser session:

```python
from browser_manager import BrowserManager
from browser_manager.browser import Firefox

# Create an instance of the BrowserManager class
browser_manager = BrowserManager()

# Select the preferred browser by passing the desired browser class (Firefox)
# If it's not available, a selection will be presented.
browser = browser_manager.select_browser(Firefox)
print(f"Selected browser: {browser.name}")  # Print the name of the selected browser

# Select the preferred profile for the chosen browser by passing the profile name "default-release"
# If it's not available, a selection will be presented.
# Selecting a profile is optional
profile = browser.select_profile("default-release")
print(f"Selected profile: {profile['name']}")  # Print the name of the selected profile
print(f"Selected profile folder: {profile['path']}")  # Print the path of the selected profile

# Get the driver for the selected browser
driver = browser.get_driver()
print(f"Driver Path: {browser.driver_path}")  # Print the path of the driver
print(f"Driver: {driver}")  # Print the driver object

# Navigate to Google
driver.get("https://google.com")
print(driver.title)

# Wait for user input before closing the browser session
input("Press Enter to close the browser...")

# Close the browser session
driver.quit()
```

### Example Usage Directly from Firefox

Here’s how to use the `Firefox` class directly:

```python
from browser_manager.browser import Firefox

# Create an instance of the Firefox browser
browser = Firefox()

# Select the preferred profile for the chosen browser by passing the profile name "default-release"
# If it's not available, a selection will be presented.
# Selecting a profile is optional
profile = browser.select_profile("default-release")
print(f"Selected profile: {profile['name']}")  # Print the name of the selected profile
print(f"Selected profile folder: {profile['path']}")  # Print the path of the selected profile

# Get the driver for the selected browser
driver = browser.get_driver()
print(f"Driver Path: {browser.driver_path}")  # Print the path of the driver
print(f"Driver: {driver}")  # Print the driver object

# Navigate to Google
driver.get("https://google.com")
print(driver.title)

# Wait for user input before closing the browser session
input("Press Enter to close the browser...")

# Close the browser session
driver.quit()
```

### Basic Usage Example

Here’s a simple example of how to directly use the Firefox browser with the BrowserManager library:

```python
from browser_manager.browser import Firefox

# Create an instance of the Firefox browser
driver = Firefox().get_driver()

# Navigate to Google
driver.get("https://google.com")
print(driver.title)

# Wait for user input before closing the browser session
input("Press Enter to close the browser...")

# Close the browser session
driver.quit()
```

## Supported Platforms

- **Windows**
- **Linux**
- **macOS**

## License

This project is licensed under the MIT License.

## Contact

For any inquiries, please contact: [contato@tpereira.com.br](mailto:contato@tpereira.com.br)


## Contributing

Feel free to submit pull requests or open issues to improve the library. Please ensure that your code follows the repository's coding standards and is well-documented.
```
