public async Task <ActionResult> Search(SearchInvestigationViewModel model) { if (!ModelState.IsValid) { return(View("Index", model)); } string search = string.Join("+", model.SearchTerm.Split(' ')); var searchResults = new List <string>(); // Create an instance of the browser and configure launch options Browser browser = await Puppeteer.LaunchAsync(new LaunchOptions { Headless = true }); foreach (var searchEngine in model.SearchEngines) { if (searchEngine.Enabled == true) { await RunSearch(searchEngine, search, browser); } } // Close the browser await browser.CloseAsync(); return(View("SearchResults", model)); }
public ActionResult Index() { var viewModel = new SearchInvestigationViewModel(); viewModel.SearchEngines = this.SearchEngines; return(View(viewModel)); }