Skip to content

Browser

Manuel Cabral edited this page May 19, 2023 · 6 revisions

The Browser class that allows you to get information about a specific installed browser.

Properties

class pybrinf.Browser

  • name

    Get the name of the browser.

    Returns -> str

  • fullname

    Get the fullname of the browser.

    Returns -> str

  • process

    Get the process of the browser.

    Returns -> str

  • version

    Get the version of the browser.

    Returns -> str

  • path

    Get the path storage of the browser.

    Returns -> str

  • app_path

    Get the app path of the browser.

    Returns -> str

  • installed

    Check if the browser is installed in your system.

    Returns -> bool

  • dev_tools

    Get the dev tools status of the browser.

    Returns -> bool

  • running

    Check if the browser is running in your system.

    Returns -> bool

Methods

  • set_app_path()

    Set the app path of the browser.

    IMPORTANT: This method is used when the browser is not in the default app path.

    Returns -> None

  • set_local_path()

    Set the local storage path of the browser.

    IMPORTANT: This method is used when the browser is not in the default local path.

    Returns -> None

  • open()

    Opens a website in the browser (new window).

    Arguments

    • url_(str)_: The url to open.

    Returns -> bool

  • close()

    Close the browser (if is running).

    Returns -> bool

  • session()

    Get the last session of the browser. Only chromium browsers are supported for now.

    IMPORTANT: If you get an access denied error, close the browser and try it again.

    Returns -> class pybrinf.Session

  • history()

    Get the history of the browser.

    IMPORTANT: Limit the number of results to avoid performance issues.

    Arguments

    • reverse (bool): If True will be sorted in reverse order.
    • exclude (str, list[str]): Exclude especific browsers from the history.
    • limit (int): The maximum number of history items for each browser.
    • offset (int): The offset of the history items for each browser.

    Returns -> [class pybrinf.item.History]

  • downloads()

    Get the list of downloaded items from the browser.

    IMPORTANT: Limit the number of results to avoid performance issues.

    Arguments

    • limit (int): The limit of the items to get.
    • offset (int): The offset of the items to get.

    Returns -> [class pybrinf.item.Downloaded]

  • dev_tools()

    Set the dev tools status of the browser.

    Arguments

    • value (bool): The value to define.

    Returns -> None

  • tabs()

    Get the list of tabs from the browser in dev tools mode.

    IMPORTANT: The browser should be open with dev tools enable.

    Returns -> [class pybrinf.item.Tab]