private IWebDriver CreateIWebDriverFabricMethod(SupportedSeleniumBrowsers webDriver) { IWebDriver driver; var driverDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); switch (webDriver) { case SupportedSeleniumBrowsers.Chrome: var options = new ChromeOptions(); if (Properties.Settings.Default.IsUseProxy) { var proxy = new Proxy() { Kind = ProxyKind.System }; options.Proxy = proxy; if (Properties.Settings.Default.IsUseLoginAndPassword) { proxy.SocksUserName = Properties.Settings.Default.Login; proxy.SocksPassword = Properties.Settings.Default.Password; } } driver = new ChromeDriver(driverDirectory, options); break; case SupportedSeleniumBrowsers.FireFox: driver = new FirefoxDriver(driverDirectory); break; case SupportedSeleniumBrowsers.Opera: driver = new OperaDriver(driverDirectory); break; case SupportedSeleniumBrowsers.Safari: driver = new SafariDriver(driverDirectory); break; case SupportedSeleniumBrowsers.Edge: driver = new EdgeDriver(driverDirectory); break; case SupportedSeleniumBrowsers.IE: driver = new InternetExplorerDriver(driverDirectory); break; default: driver = null; break; } return(driver); }
public ParserSettings(SupportedSeleniumBrowsers browser, TypeOrganization typeOrganization) { Browser = browser; TypeOrganization = typeOrganization; }
public ScopusParser(SupportedSeleniumBrowsers browser) { _driver = CreateIWebDriverFabricMethod(browser); }