public static List <Record> ScrapeCurrencyData(string currency) { GeneralExtensions.Output($"{currency} currency record scraping in progress..."); var records = WebRequestsResponses.CreateWebRequest(UrlConstants.BankOfChina) .GetHtmlDocumentWithCurrencyData(currency) .GetRecords(currency); GeneralExtensions.Output($"{currency} currency record scraping finished... {records.Count} records scraped"); return(records); }
static void ScrapeRemainingPages(List <List <string> > listOfRows, int numberOfPages, string currency) { for (int pageNumber = 2; pageNumber <= numberOfPages; pageNumber++) { GeneralExtensions.Output($"{currency} page {pageNumber} record scraping in progress..."); var httpWebRequest = WebRequestsResponses.CreateWebRequest(UrlConstants.BankOfChina); var htmlDocument = httpWebRequest.GetHtmlDocumentWithCurrencyData(currency, pageNumber); listOfRows.AddRange(htmlDocument.GetDataByTableRows()); } }
static List <string> GetCurrencies() { var initialHttpWebResponse = WebRequestsResponses.GetInitialResponse(); var currencies = initialHttpWebResponse .GetHtmlDocument() .GetCurrencies(); GeneralExtensions.Output($"{currencies.Count} currencies loaded..."); return(currencies); }