Skip to content

How to Configure Browser Type#

Basic Usage#

If you want to use different types of browsers – for example, Firefox, Edge, Chrome, etc. – define this in the BrowserSettings class:

Python
1
2
3
4
5
6
7
from browserist import Browser, BrowserSettings, BrowserType

settings = BrowserSettings(type=BrowserType.FIREFOX)

with Browser(settings) as browser:
    browser.open.url("https://example.com")
    browser.wait.seconds(5)

Supported Browsers#

Name Type Notes
Chrome BrowserType.CHROME Default (except for Windows)
Edge BrowserType.EDGE Default for Windows
Firefox BrowserType.FIREFOX
Internet Explorer BrowserType.INTERNET_EXPLORER
Safari BrowserType.SAFARI

More information about installation of browser drivers.

How to Run Multiple Browsers#

When you have multiple browser drivers installed, you can run them in sequence like this:

Python
from browserist import Browser, BrowserSettings, BrowserType

chrome = BrowserSettings(type=BrowserType.CHROME)
edge = BrowserSettings(type=BrowserType.EDGE)
firefox = BrowserSettings(type=BrowserType.FIREFOX)

for settings in [chrome, edge, firefox]:
    with Browser(settings) as browser:
        browser.open.url("https://example.com")
        browser.wait.seconds(5)