diff --git a/html2image/html2image.py b/html2image/html2image.py index 7e46f30..73e2624 100644 --- a/html2image/html2image.py +++ b/html2image/html2image.py @@ -96,7 +96,10 @@ def __init__( browser_class = browser_map[browser.lower()] - if isinstance(browser_class, CDPBrowser): + # browser_map stores classes, not instances. Use ``issubclass`` to + # check if the selected browser class supports the Chrome DevTools + # Protocol and therefore expects the ``cdp_port`` argument. + if issubclass(browser_class, CDPBrowser): self.browser = browser_class( executable=browser_executable, flags=custom_flags,