Source code for utils.Config

from selenium import webdriver


[docs]class Config: """ The config class is used to set the browser options. :param headless: Creates a headless session if True. Default is True. """ def __init__(self, headless: bool = True) -> None: user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4183.83 Safari/537.36" self.options = webdriver.ChromeOptions() if headless: self.options.headless = True self.options.add_argument(f'user-agent={user_agent}') self.options.add_argument("--window-size=1920,1080") self.options.add_argument('--ignore-certificate-errors') self.options.add_argument('--allow-running-insecure-content') self.options.add_argument("--disable-extensions") self.options.add_argument("--proxy-server='direct://'") self.options.add_argument("--proxy-bypass-list=*") self.options.add_argument("--start-maximized") self.options.add_argument('--disable-gpu') self.options.add_argument('--disable-dev-shm-usage') self.options.add_argument('--no-sandbox')