public async Task TestMethod1() { // delete table StorageAccount .CreateCloudTableClient() .GetTableReference(TableName) .DeleteIfExists(); // load, parse var client = new DmmGameRankingClient(); var html = File.ReadAllText(LocalHtmlPath); await client.LoadFromHtmlAsync(html); var elements = client.Parse(); elements.Any().IsTrue(); var tableClient = new DmmGameRankingTableClient(StorageAccount, TableName); var nowStr = DateTime.Now.ToString("yyyyMMdd_HHmmss"); var entities = elements.Select(x => new DmmGameRankingEntity { GameTitle = x.Name, ObservedDateTime = nowStr, Rank = x.Rank, Genre = x.Genre, Comment = x.Comment, }); await tableClient.AddOrUpdateAsync(entities); }
public async Task ParseTest() { var client = new DmmGameRankingClient(); var html = File.ReadAllText(LocalHtmlPath); await client.LoadFromHtmlAsync(html); var elements = client.Parse(); elements.Any().IsTrue(); }