You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RedditVideoMakerBot/webdriver/web_engine.py

23 lines
408 B

from typing import Union
from webdriver.pyppeteer import RedditScreenshot as Pyppeteer
def screenshot_factory(
driver: str,
) -> Union[Pyppeteer]:
"""
Factory for webdriver
Args:
driver: (str) Name of a driver
Returns:
Webdriver instance
"""
web_drivers = {
"pyppeteer": Pyppeteer,
"playwright": None,
}
return web_drivers[driver]